An open API service indexing awesome lists of open source software.

https://github.com/mryslab/nanoconnecthcsr04

Arduino Nano RP2040 Connect PIO-based library for the HCSR04 Ultrasonic Distance Sensor.
https://github.com/mryslab/nanoconnecthcsr04

Last synced: about 1 year ago
JSON representation

Arduino Nano RP2040 Connect PIO-based library for the HCSR04 Ultrasonic Distance Sensor.

Awesome Lists containing this project

README

          

# NanoConnectHcSr04

## An Arduino Nano RP2040 Connect library for HC-SR04 type ultrasonic distance sensors.

## It is implemented using the RP2040 PIO processor.

Here is a sample sketch that continuously reads and prints distances:

```asm

#include

// D11 (7) == trigger, D12 (4) == echo
// Using pio0 and sm 0
NanoConnectHcSr04 sonar(7,4, pio0, 0);

// distance value returned
float value = 0.0;

void setup() {
Serial.begin(115200);

}

void loop() {
// put your main code here, to run repeatedly:
value = sonar.readSonar();
Serial.println(value);
}
```