PlatformIO Core (CLI) is a command-line tool that consists of a multi-platform build system, platform and library managers and other integration components. PlatformIO IDE is a toolset for embedded C/C++ development available on Windows, macOS and Linux platforms PlatformIO includes lots of instruments for the most common development tasks such as debugging, unit testing, and static code analysis.Ī detailed overview of the PlatformIO ecosystem and its philosophy can be found in the official documentation. It has out-of-the-box support for ESP32 SoCs and allows working with Arduino ESP32 as well as ESP-IDF from Espressif without changing your development environment. If(Wire.PlatformIO is a professional collaborative platform for embedded development. Wire.requestFrom(SensorAddress, byte(2)) Returns the last range that the sensor determined in its last ranging cycle in centimeters. Wire.endTransmission() //Stop and do something else now ![]() ![]() Wire.write(RangeCommand) //send range command Wire.beginTransmission(SensorAddress) //Start addressing Commands the sensor to take a range reading Serial.print("Range: ") Serial.println(range) //Print to the user Word range = requestRange() //Get the range from the sensor TakeRangeReading() //Tell the sensor to perform a ranging cycle Serial.begin(115200) //Open serial connection at 9600 baud These are the two commands that need to be sent in sequence to change the sensor address The sensors ranging command has a value of 0x51 ![]() The Arduino Wire library uses the 7-bit version of the address, so the code example uses 0x70 instead of the 8-bit 0圎0 For and Arduino Board it is not a problem, but for the ESP32. However, I keep getting an error while compiling. I'm trying to get a GY-US-42 ultrasonic sensor working on the ESP32.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |