-
• #2
Hi,
Take a look at: http://www.espruino.com/ReferenceESPRUINOBOARD
And the Arduino example: http://arduino.cc/en/tutorial/ShiftOut
Looks like you need 3 wires - Data, Clock, and latch. Because Espruno does software SPI, you can actually use any 3 IO pins.
The code you might use is:
var spi = new SPI(); spi.setup({mosi: MY_DS_PIN, sck: MY_SH_CP_PIN }); spi.write(my_data, MY_ST_CP_PIN);
-
• #3
Thank you Gordon , I really have a first reference Arduino Sample, as you said, I set a MY_DS_PIN = B5, MY_SH_CP_PIN = B3, any 3 IO pins, can not take it?
-
• #4
Well, you have 2 options:
- Use hardware SPI (in which case you must use specific pins - like B3 and B5)
- Use software SPI (in which case you can use any pins you want to)
For software, the code looks like I pasted above. For hardware, it looks like this:
SPI3.setup({mosi: B5, sck: B3 }); SPI3.write(my_data, MY_ST_CP_PIN);
- Use hardware SPI (in which case you must use specific pins - like B3 and B5)
Currently I need to implement multiple LED using 74hc595 ic corresponds to espruino, but I do not know the way the corresponding pin