IR Sensor Interface With STM32
Circuit Diagram: Code: int obstaclePin = PB1; // This is our input pin void setup() { pinMode(obstaclePin, INPUT); pinMode(PB10, OUTPUT); Serial.begin(115200); } void loop() { int hasObstacle = digitalRead(obstaclePin); if (hasObstacle == LOW) { digitalWrite(PB10, HIGH); // turn the LED on (HIGH is the voltage level) } else { digitalWrite(PB10, LOW); // turn […]
IR Sensor Interface With STM32 Read More »