Arduino sketches
Choose a sketch to download its .ino file. These are generated samples for an Arduino Uno R3 (5V), not hardware-tested lessons. Owner-supplied sketches will be added separately.
Download requires only a browser. To use a sketch later, open it in Arduino IDE, accept its offer to create a matching sketch folder, select the Uno board and port, then upload. Wire components with power disconnected.
New to Arduino? Follow Upload a saved sketch to Arduino with your teacher.
LED blink
Blinks the built-in LED once per second. No external components or wiring.
Download LED blink (.ino)Buzzer
Sounds a short tone once per second. Use a passive piezo element: D8 through a 100-ohm resistor to piezo positive, negative to GND. This sample is not for magnetic or high-current buzzers.
Download buzzer (.ino)Ultrasonic sensor
For an HC-SR04: VCC to 5V, GND to GND, TRIG to D7, ECHO to D6. Open Serial Monitor at 9600 baud for distance in centimetres or a timeout message. Do not connect the 5V echo directly to a 3.3V-only board.
Download ultrasonic sensor (.ino)Motor control
Runs a DC motor for two seconds, then puts its driver in standby for two seconds. Requires a TB6612FNG breakout and a separate motor supply. Use channel A: PWMA to D9, AIN1 to D4, AIN2 to D5, STBY to D8, VCC to Uno 5V, and motor to AO1/AO2. Join all grounds. Connect VM to the separate supply, matched to the motor and breakout voltage/current ratings, including motor stall current.
Tie unused BIN1, BIN2 and PWMB to GND. Use a breakout without an STBY pull-up and fit a 10k-ohm resistor from STBY to GND to keep the driver in standby during reset. Never power a motor from an Uno GPIO or its 5V pin. Confirm your breakout labels and supply requirements before wiring.
Download motor control (.ino)References: Arduino Blink, Arduino language reference, HC-SR04 sensor documentation, and TB6612FNG pin guide.