Hi! I'm currently creating a line-following robot with arduino and I'm using line sensors, but also trying to use little LED lights like it would be a police car with the lights. Unfortunately I'm new to the code and I'm not entirely sure how to get the two codes to work together so the lights and the sensors both work, because right now the sensors work without the LED code, but when I add the LED code in, the lights and wheels work but not the sensors. I was wondering if someone could help me out with this?
The main code is from my class, and below is my code for the lights, it's in the code at the bottom. I've attached the whole code.
void setup(){
pinMode(10,OUTPUT);
pinMode(11,OUTPUT);
}
void loop(){
digitalWrite(10,LOW);
digitalWrite(11,HIGH);
delay(250);
digitalWrite(10,HIGH);
digitalWrite(11,LOW);
delay(250);
}
line_following_robot.ino (5.27 KB)