Skip to content

Instantly share code, notes, and snippets.

View pprishchepa's full-sized avatar

Pavel Prishchepa pprishchepa

View GitHub Profile
#include <Servo.h>
static const uint8_t SERVO_PIN = 9;
static const uint8_t TRIG_PIN = 10;
static const uint8_t ECHO_PIN = 11;
Servo s;
long readDistanceCm() {
// Trigger pulse