How to use SPI PINs and duplicated D5-D7 as IO PINs?

  • Hello, I am new to Wemos D1 board and would like to move my sketch from Arduino UNO board to Wemos D1 R2 v.2.1.0. I have to use SPI for MFRC-522 RFID card reader (PINs SCK/D5, MISO/D6, MOSI/D7, D8/SS and D4 for RESET PIN). Based on product description, this board should have 11 digital PINs, but how to use D5-D7 (without SPI description) as IO? I need another 4 PINs for keypad and 1 for buzzer.

  • Not sure what you mean by "how". You just connect them with wires as normal, and write a program that uses SPI to communicate with the device, according to the protocol described in its datasheet. You can use these pins as digital pins when not communicating with the device with the SS pin high, but you have to make sure to use resistors for whatever you are connecting to them, so that the SPI peripheral can still drive them.

Log in to reply

Looks like your connection to WEMOS Forum was lost, please wait while we try to reconnect.