-->
Page 1 of 1

Ultrasonic Sensor HC-SR04 library for ESP8266

PostPosted: Tue Sep 22, 2015 4:15 pm
by jeanfs
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!

Re: Ultrasonic Sensor HC-SR04 library for ESP8266

PostPosted: Tue Sep 22, 2015 8:04 pm
by martinayotte
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.