Skip to content

Instantly share code, notes, and snippets.

View GettyOrawo's full-sized avatar

Getty Orawo GettyOrawo

View GitHub Profile
const int TRIG_PIN = 4;
const int ECHO_PIN = 5;
const int BUZZER_PIN = 3;
const int DISTANCE_THRESHOLD = 30;
// variables will change:
float duration_us, distance_cm;
void setup() {
Serial.begin (9600);