Skip to content

Instantly share code, notes, and snippets.

View mendax1234's full-sized avatar

Wenbo (Daniel) Zhu mendax1234

View GitHub Profile
@mendax1234
mendax1234 / EG1311_Final_Project
Created November 30, 2024 08:52
EG1311 B13 T06 (AY24/25 Sem1) Code
#include <Servo.h>
int TRIG_PIN = 13;
int ECHO_PIN = 12;
int MOTOR_PIN1 = 5;
int MOTOR_PIN2 = 6;
int SERVO_PIN = 3;
float SPEED_OF_SOUND = 0.0345;
bool is_backward = false;
unsigned long forward_time;
Servo servo;