Use this forum to chat about hardware specific topics for the ESP8266 (peripherals, memory, clocks, JTAG, programming)

User avatar
By jeanfs
#29669 Hi guys,

I already have an application using arduino and Zigbee where I use one digital temperature sensor and one ultrasonic sensor. Now I´m trying to change everything and only use the ESP8266 for that. I found that the source code that I just download here in the website has an OnWire library that fits to my temperature sensor, but I didn´t find any library for the ultrasonic sensor, actually I found many but only using the NodeMCU.

My question is: Can I use the regular Ultrasonic library that I used on my Arduino on the ESP? If the answer is yes, can I use all the libraries for the Arduino in the ESP?

Thanks for the help!
User avatar
By martinayotte
#29685
jeanfs wrote:My question is: Can I use the regular Ultrasonic library that I used on my Arduino on the ESP? If the answer is yes, can I use all the libraries for the Arduino in the ESP?


Ultrasonic livrary, probably !
All the libraries ? maybe not all, but a lot. Some need to be adapt for the ESP, a bit like some AVR libs as been adapted for Teensy or STM32, there sometimes bugs related to the fact it is 32 bits, not 8 bits, some other times AVR libs use specific AVR registers which need to be translate to equivalent on the new hardware, etc.