Skip to content

MrYsLab/NanoConnectHcSr04

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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:

#include <NanoConnectHcSr04.h>

// 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);
}

About

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

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors