Now that everything is wired and coded, it’s time to test your first interactive Arduino project!
✅ Steps to Run:
Open the Arduino IDE on your computer.
Select the correct board: Tools > Board > Arduino UNO.
Select the correct port: Tools > Port (usually something like COM3 or ttyUSB0).
Copy and paste the sample code into the IDE.
Click the Upload button (right arrow icon).
Wait for the message Done uploading in the status bar.
🧪 How to Test:
Press the button on the breadboard.
If the LED lights up while pressing and turns off when released – 🎉 it works!
If not, don’t worry — that’s what debugging is for.
Your set-up will look something similar, do check the PIN's ID and change the code accordingly.
🛠️ Debugging Tips:
Check if the LED is placed correctly — long leg to pin 13, short to GND.
Make sure resistors are connected as shown in the diagram.
Use the Serial Monitor (under Tools) to print out the button state:
void loop() {
buttonState = digitalRead(buttonPin);
Serial.println(buttonState); // helps see if button is working
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);
} else {
digitalWrite(ledPin, LOW);
}
}
Double-check pin numbers in code match your connections.
This is your first hands-on mini project, and it’s okay if you need a few tries. Learning to build, test, and debug is part of becoming a real robotics maker!