-
-
Little question, though: using eith 8 wires or I2C is mandatory to have quicker response between lcd.clear() & the next lcd.print call ?
I believe the module is just as quick in 4 or 8 bit mode...
I think from what you are asking - you are getting a flicker on the display?
Instead of usingclear
just set the cursor location and over type the characters use ' ' to clear a single char.... Then you won't get any flickering -
-
-
I've used the same remote using the IRreciever module - posted here..
http://forum.espruino.com/conversations/287385/#comment13013007
-
-
http://www.jaycar.co.nz/Active-Components/Optoelectronics/Optocouplers/IR-LED-Receiver/p/ZD1953
IR LED Receiver
CAT.NO: ZD1953
TSOP4136 IR ReceiverConsists of PIN diode, pre-amplifier, AGC, pass filter, and demodulator. The main benefits are high speed data rates, short burst ...It's the 36 rather than 38, but that was 3x the price and it seems to work fine!
-
It could be power supply - when the default wifi access point fires up, the current drain is enough to cause it lock up, and then the watch dog fires and it resets.
Try another port or on another computer - or plug it into a wall plug 5v charger and see if you can see it as a wifi access point the Sid would show as ESPxxxx . If you can connect to that ok, then you can connect the web ide to that on 192.168.4.1
Then get it to join your wifi network and use the local address it gets assigned in the web ide...
-
-
-
-
Not sure how to determine the string length. - I could save to
this
in a local version of the module and monitor that.I'll try the 100 length.
The remotes I have seem to send 1's after fixed length (33 bytes in most cases) as repeat code if a button is constantly hit. If the constructor knew the length, a repeated event could be emitted. Not sure how to handle or perhaps retrigger the code sent?
I've bee also thinking about how the codes could be shortened instead of sending a string of 1 and 0's, perhaps a hex code? -
This is using SPI to drive a nokia display on an ESP8266:
http://forum.espruino.com/conversations/287196/#comment12997920
-
require("IRReceiver").connect(NodeMCU.D1, function(code) { console.log(code); if ( code.length >= 33 ) { var l=parseInt(code.slice(1,16),2); if ( l === 15344 ) { lcd.setCursor(0,1); var k=parseInt(code.slice(17,21),2); console.log({k:k,b:button[k]}); lcd.clear(); lcd.print(button[k]); } } });
I have discovered at night a fluro lamp triggers the IR reciever. These random pulses after a couple of hours trigger this:
11111111111111111111111111111111111111111111111111111111111101111111111110111 11111111111111111110111111111111111111111110 1111111111111111111111111111111111111111111110111111111111111111101111 11111111111111111111111111111111011111111111 0111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111101111111111111111111111111111111111111110111111111111110111101111111111111111111111111111111111111111111111110111111111111111111111111111111111111111111111111111111 11111111111111111111110111011111111111111111111111111111111111111111110111111111111111111111111111110111111111111111111111111101111111111111111111110111111111111111111111111011111111111111111111111011111111111111111110111111111111111111111111111111111111111111111101010111111111111111111111111111111111111111111111110111011111111111111111111111111111111111101111111111111111111101101111111011111111111111111011111111111111111101111111111111111111111111111111111111111011111111111101011111111111111111111111 ERROR: Out of Memory! ERROR: Ctrl-C while processing watch - removing it. Execution Interrupted during event processing. at line 1 col 40 ...astTime;b&&(clearTimeout(b),b=void 0);.04<c?(""!==a&&e(a),a=... ^ in function called from system >
it appears to be in this block:
// set our callback to happen whenever pin goes low (eg, whenever pulse starts) setWatch(function(e) { var d = e.time-e.lastTime; if (timeout) { clearTimeout(timeout); timeout = undefined; }
I believe the cause is here:
if (d>0.04) { // a gap between transmissions if (code!=="") callback(code); code = ""; } else { code += 0|d>0.0008;
So code just keeps getting longer.... I wondering what the best way is to make this robust?
Set a watch dog timer that truncates the
code
string if it gets too long, or simply controls it's length? -
-
-
I2C1.setup({scl:NodeMCU.D5, sda:NodeMCU.D4}); var lcd = require("HD44780").connectI2C(I2C1); lcd.print("Hello World!"); lcd.setCursor(0,1); lcd.print("ESP8266!"); /* I2C1 SPI1 NodeMCU.D1 D5 GPIO5 NodeMCU.D2 D4 GPIO4 NodeMCU.D3 D0 GPIO0 FLASHBTN / Built in LED NodeMCU.D4 D2 GPIO2 SDA Debug Serial - RX1 on FTDI chip NodeMCU.D5 D14 GPIO14 SCL CLK NodeMCU.D6 D12 GPIO12 MISO NodeMCU.D7 D13 GPIO13 MOSI NodeMCU.D8 D15 GPIO15 CS NodeMCU.D9 D3 GPIO3 NodeMCU.D10 D1 GPIO1 NodeMCU.A0 D0 GPIOx */ //1011101111110000 101010000 10001111 /* Apple white remote 33 bits - spaces added 10111011111100001 0101 000010001111 up 10111011111100001 1001 000010001111 left 10111011111100001 1010 000010001111 play 10111011111100001 0110 000010001111 right 10111011111100001 0011 000010001111 down 10111011111100001 1100 000010001111 menu longer codes - last 1's are button repeats */ var button={5:'up',9:'left',10:'play',6:'right',3:'down',12:'menu'}; require("IRReceiver").connect(NodeMCU.D1, function(code) { console.log(code); if ( code.length >= 33 ) { var l=parseInt(code.slice(1,16),2); if ( l === 15344 ) { lcd.setCursor(0,1); var k=parseInt(code.slice(17,21),2); console.log({k:k,b:button[k]}); lcd.clear(); lcd.print(button[k]); } } });
10111011111100001100100001000111111 { "k": 9, "b": "left" } 10111011111100001010100001000111111 { "k": 5, "b": "up" } 101110111111000010011000010001111 { "k": 3, "b": "down" } 101110111111000011010000010001111 { "k": 10, "b": "play" } 101110111111000010110000010001111 { "k": 6, "b": "right" } 10111011111100001110000001000111111 { "k": 12, "b": "menu" }
-
-
ESP8266 - PCF8574 8 bit IO expander from DX.com
pinMode(NodeMCU.D5,'input_pullup'); pinMode(NodeMCU.D4,'input_pullup'); I2C1.setup({scl:NodeMCU.D5, sda:NodeMCU.D4}); var lcd = require("HD44780").connectI2C(I2C1); lcd.print("Hello World!"); lcd.setCursor(0,1); lcd.print("ESP8266!");
I'm not sure if the pull up lines even have an effect, as it works without them too!
-
Display NodeMCU ESP-12 Colour LED 3V3 3V3 N/A SCLCK D5 GPIO14 Green DN<MOSI> D7 GPIO13 Yellow D/C D2 GPIO04 Orange RST D1 GPIO05 Brown SCE D8 GPIO15 Red GND GND GND Grey VCC 3V3 3V3 Blue BackLight GND GND Purple
this board is different than @Ducky 's as the backlight is taken to ground to enable
-
Thanks to @ducky http://forum.espruino.com/comments/12949433/
Here are pictures showing the wiring colours on a breadboard.
SPI1.setup({ sck:NodeMCU.D5, mosi:NodeMCU.D7 }); var g = require("PCD8544").connect(SPI1, NodeMCU.D2 /* RS / DC */, NodeMCU.D8 /* CS / CE */, NodeMCU.D1 /*RST*/, function() { g.clear(); g.setRotation(2); //Flip display 180 g.drawString("Hi Esp8266",0,0); g.drawLine(0,10,84,10); g.flip(); });
-
Here is a solid state relay that can switch DC:
http://www.dx.com/p/ssr-10dd-solid-state-relay-white-silver-232097#.V1a2zm6eqrU
There are different models, with different amp loads and for ac or DC.
http://www.dx.com/s/solid+state+relay