-
-
Thanks a lot @Gordon and @Wilberforce. I have tried the new code. Good news is that I no longer get "Guru Meditation error", but I get data like below.
I understand that DHT11 now works for @Gustav on ESP32. There is as much time that you guys can spend on this, I have read that DHT11 is not the best sensor as well. I am pretty sure this works flawlessly on the official boards. I'll try to get myself one.
Thanks a lot for all the help. Really appreciate it.
{"err":true,"checksumError":true,"raw":"101010100110000000000010111000","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1} {"err":true,"checksumError":true,"raw":"10101010011000000000001011100000000011010101","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"0","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"0","temp":-1,"rh":-1} {"raw":"0101010011000000000001011100000000011010101","rh":83,"temp":23} {"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"0","temp":-1,"rh":-1} {"err":true,"checksumError":true,"raw":"1010101001000000000000101110000","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"0","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1} {"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1} {"raw":"10101010010000000000001011100000000011010011","rh":169,"temp":11}
-
-
-
Hello,
I originally had a 10k pull-up resistor between the Data and Vcc pins. I have now tried 1K resistor but that has not helped either.Interestingly, I have observed that I either get No data or a "Guru Meditation Error of type IllegalInstruction occurred on core 0. Exception was unhandled." based on which pin I choose.
e.g.
pin 15 - {"temp":-1,"rh":-1} pin 22 - Guru Meditation Error of type IllegalInstruction occurred on core 0 pin 16 - Guru Meditation Error of type IllegalInstruction occurred on core 0
I think this person is facing the same issue. http://forum.espruino.com/conversations/316936/
Thanks a lot.
-
Thanks for the reply. Much appreciated.
I am using 1v95 firmware. I have also downloaded the latest "espruino_1v95_esp32.bin" from http://www.espruino.com/binaries/travis/master/
but no success. -
Hello,
I am trying to get DHT11(temperature and humidity) sensor working with Espruino on ESP32. I get the below output, which as per the documentation means no data is being received.{"err":true,"checksumError":false,"raw":"","temp":-1,"rh":-1}
Code
var dht = require("DHT11").connect(D17); function onInit() { setInterval(function () { dht.read(function (a) { console.log(JSON.stringify(a)); }); }, 3000); } onInit();
Interestingly, with the same wiring DHT11 works fine using "Arduino core for ESP32". Not sure what I am doing wrong in the Espruino.
This is the board that I am using https://wiki.wemos.cc/products:lolin32:lolin32
Pin out - https://arduino-projekte.info/wp-content/uploads/2017/07/lolin32_pinout.pngThanks in advance.
-
You are right, I was unnecessarily complicating things. Thanks a lot for your suggestion @DrAzzy
This is what I have got now
let ledBrightness = 0; let ledPin = D15; let fadeIn = false; function fadeLED() { if((ledBrightness <= 0) || (ledBrightness >= 1)){ fadeIn = !fadeIn; } setLedBrightness(fadeIn); } function setLedBrightness(fadeIn){ if(fadeIn){ ledBrightness += 0.01; } else { ledBrightness -=0.01; } analogWrite(ledPin, ledBrightness); } setInterval(fadeLED , 10);
-
I have got it to work(sort of), but I am not happy with it. It feels like there is/should be a better way to do it than below.
While googling I found this jhonny-five example, which is quite nice. https://github.com/rwaldron/johnny-five/blob/master/docs/led-fade.md
A LED class might make it easier for a beginner like me to start with Espruino. In all, loving Espruino so far. Need to learn Javascript to fully appreciate it though.
/* This example works by dividing 1 second into 10 ms time intervals and increasing/decreasing the led's analogWrite output by .01 per interval, to produce the fade-in and fade-out effects. */ var ledPower =0; var ledPin = D15; function fadeIn(callback){ //start fadeIn effect should take 1 second to finish. var result = setInterval(function(){ analogWrite(ledPin, ledPower); ledPower+= 0.01; if(ledPower >= 1){ clearInterval(result); return; } }, 10); //set the fade-out effect to start after 1 second. setTimeout(callback, 1000); } function fadeOut(){ var result = setInterval(function(){ analogWrite(ledPin, ledPower); ledPower-= 0.01; if(ledPower <= 0){ clearInterval(result); return; } }, 10); } setInterval(function(){ fadeIn(fadeOut); } , 2000);
-
Hello,
I am new to Espruino and Javascript and am struggling with the asynchronous nature of it. For my first shot at Espruino, I tried to fade in and out an LED. I have done this before in Arduino, but struggling here. What's the best way to do it?Here is what I did, but I realize this is wrong as both the
fadeIn
andfadeOut
methods a running in parallel. Thanks in advance.var ledPower = 0; var ledPin = D15; function fadeIn(){ var result = setInterval(function(){ if(ledPower >= 1){ clearInterval(result); } ledPower+= 0.001; analogWrite(ledPin, ledPower); }, 50); } function fadeOut(){ result = setInterval(function(){ if(ledPower <= 0){ clearInterval(result); } ledPower-= 0.001; analogWrite(ledPin, ledPower); }, 50); } while(true){ ledPower =0; fadeIn(); fadeOut(); }
Hello,
I'm trying to get Bluetooth working on an ESP32 but running into a problem.
When I run
I see an error like below. Not sure what it means.
https://imgur.com/yjQ38EY
In the IDE I tried running the below code
The code uploads and I'm can connect to the device using NRF Connect app. However, when I try to send a value I get the below error
https://imgur.com/yjQ38EY
Please let me know what I'm doing wrong.