i'm running into a problem with rules.
Device: NodeMCU V3, ESPeasy R131.
Using a GP2Y-dust sensor, an OLED display and a RGB LED.
The sensor works well, display too. I wanted the LED as a quick indicator of air quality
and used some rules for color changing (don't be annoyed by the values, it's just for testing)
The LED is connected via standard NPN transistors to GPIO 12,14 and 15
Code: Select all
on GP2Y#Dust do
if [GP2Y#Dust] > 160
gpio,14,0
else
gpio,14,1
endif
if [GP2Y#Dust] > 80
gpio,12,1
endif
if [GP2Y#Dust] < 81
gpio,12,0
endif
if [GP2Y#Dust] > 320
gpio,12,0
endif
if [GP2Y#Dust] > 240
gpio,15,1
else
gpio,15,0
endif
if [GP2Y#Dust] > 400
gpio,12,0
gpio,15,0
gpio,14,0
endif
endon
The serial output looks like this:
Code: Select all
GPY : Dust value: 6713
EVENT: GP2Y#Dust=176.74
ACT : gpio,14,0
SW : GPIO 14 Set to 0
ACT : gpio,12,1
SW : GPIO 12 Set to 1
ACT : gpio,15,0
SW : GPIO 15 Set to 0
GPY : Dust value: 6185
EVENT: GP2Y#Dust=162.79
ACT : gpio,14,0
SW : GPIO 14 Set to 0
ACT : gpio,12,1
SW : GPIO 12 Set to 1
ACT : gpio,15,0
SW : GPIO 15 Set to 0
Exception (0):
epc1=0x402471e0 epc2=0x00000000 epc3=0x00000000 excvaddr=0x00000000 depc=0x00000000
ctx: sys
sp: 3ffffd40 end: 3fffffb0 offset: 01a0
>>>stack>>>
3ffffee0: 00000000 3fffdc80 3fff4594 00000030
3ffffef0: 00000000 3ffebe98 3ffebea4 40107a78
3fffff00: 00000000 00000000 3ffebf38 00000000
3fffff10: 3ffed160 3fff44fc 3fffff50 4024733d
3fffff20: 00000002 005e0001 2a80fb00 3ffef4c0
3fffff30: 000005e0 00000000 401044f1 3fff44fc
3fffff40: 3ffed15a 00000000 3fff3f9c 402478ec
3fffff50: 9711a8c0 00000001 4010561a 3ffeea90
3fffff60: 3ffee1c0 40101f86 00000000 3ffee6b4
3fffff70: 3ffee1c0 40101d53 00000000 00000000
3fffff80: 40228276 3fffdab0 00000002 3fff4594
3fffff90: 3fffdc80 00000000 3fff3f9c 4023c37f
3fffffa0: 40000f49 3fffdab0 3fffdab0 40000f49
<<<stack<<<
ets Jan 8 2013,rst cause:4, boot mode:(3,6)
wdt reset
load 0x4010f000, len 1384, room 16
tail 8
chksum 0x2d
csum 0x2d
v09826c6d
~ld
øªU
INIT : Booting Build nr:131
WIFI : Connecting... 1
WIFI : Connected!
INIT : I2C
INIT : Boot OK
INIT : Normal boot
EVENT: System#Boot
Any idea anyone?
Regards
Shardan.