espruino 74hc595 pin corresponding problem?

Posted on
  • Currently I need to implement multiple LED using 74hc595 ic corresponds to espruino, but I do not know the way the corresponding pin

  • Hi,

    Take a look at: http://www.espruino.com/ReferenceESPRUINĀ­OBOARD

    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);
    
  • 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?

  • 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);
    
  • Post a reply
    • Bold
    • Italics
    • Link
    • Image
    • List
    • Quote
    • code
    • Preview
About

espruino 74hc595 pin corresponding problem?

Posted by Avatar for user7335 @user7335

Actions