using Arduino IDE SPI.h library with ESP32
Posted: Sat Mar 11, 2017 12:54 am
Good Day all.
I am starting my journey with the ESP32 on the Adruino IDE platform and i would like to know if anyone could clarify things for me.
I've purchase the book Kolban's book on ESP 32 and found it very interesting, however i would have appreciated more examples explaining code syntax.
Anyways, the questions i have are:
1) Can the SPI.h library be used with the esp32? I have tried countless times but cannot seem to get in working. I've used it with the Esp 8266 with no problems.
2) I found the esp32-hal-spi.h library and followed Kolban's book to transfer a few bytes, now i can see the HSPI bus is active with an oscilloscope ,but the actual data received is either all zeros or garbage. I'm certain i'm not understanding how the actual instruction is working.
Basically i need to implement this line of code,
uint8_t tmp = SPI.transfer(0);
which is from the SPI library
How would i do this using the esp32-hal-spi.h libray. Is there an equivalent?
How would i write this line for the ESP 32 in Arduino IDE?
I would really appreciate any assistance. Im sure by now it is evident that i am not a seasoned programmer ,but i do enjoy making things with these chips.
Thank you in advance.
I am starting my journey with the ESP32 on the Adruino IDE platform and i would like to know if anyone could clarify things for me.
I've purchase the book Kolban's book on ESP 32 and found it very interesting, however i would have appreciated more examples explaining code syntax.
Anyways, the questions i have are:
1) Can the SPI.h library be used with the esp32? I have tried countless times but cannot seem to get in working. I've used it with the Esp 8266 with no problems.
2) I found the esp32-hal-spi.h library and followed Kolban's book to transfer a few bytes, now i can see the HSPI bus is active with an oscilloscope ,but the actual data received is either all zeros or garbage. I'm certain i'm not understanding how the actual instruction is working.
Basically i need to implement this line of code,
uint8_t tmp = SPI.transfer(0);
which is from the SPI library
How would i do this using the esp32-hal-spi.h libray. Is there an equivalent?
How would i write this line for the ESP 32 in Arduino IDE?
I would really appreciate any assistance. Im sure by now it is evident that i am not a seasoned programmer ,but i do enjoy making things with these chips.
Thank you in advance.