The Arduino Uno is the "controller" from last class made real: a tiny computer you can program to read the world and react to it. Meet the IDE, blink your first LED, read the Serial Monitor, and send a message in Morse code.
The IDE (Integrated Development Environment) is where you write, check, and upload code called a sketch. Three buttons matter most: Verify checks your code for errors without touching the board, Upload compiles it and sends it over USB to the Arduino's memory, and the Serial Monitor opens a window that shows text your sketch sends back — your board's first "hello."
Sketch anatomy
setup() vs loop()
Every Arduino sketch has exactly two required functions. Power on the virtual board and follow the glowing token: the highlighted line is the one the processor is running right now. Then press Reset and count how many times each function runs.
Runs forever, jumping back to the top the instant it reaches the bottom. Repetition makes control possible, but feedback also requires measuring the result of an action.
Ready — press Power on to trace execution.
Hardware basics
Blink: Hello World, but with light
delay(1000) pauses for 1000 milliseconds (one second). Here pin 13 drives a red LED on a breadboard through a 220 Ω resistor — the same pin as the tiny onboard L LED (LED_BUILTIN). Drag the slider and watch the board, the running line of code, the oscilloscope trace and the Serial Monitor all respond together.
Pin 13 voltage over time timing diagram · last 6 s
Serial Monitor 9600 baud · timestamps on
Challenge
Send a message in Morse code
Modify Blink so the delay pattern spells something. Morse timing is built from one unit: a dot is 1 unit on, a dash is 3 units on, the gap inside a letter is 1 unit, between letters 3 units, and between words 7. Type a short message and the sketch is written for you — then watch it run line by line.
Letters, numbers and spaces only.
Your message as a timing diagram yellow line = now
The bigger picture: brains, robots & graphics
How do you reach for a cup? You see a target, estimate where it is, move your hand, and use new information to adjust. Neuroscience studies how nervous systems do this. Robotics builds machines that sense and act. Computer graphics draws mathematical worlds that we can see and test.
Arduino is the controller in this story: sensors provide measurements, your sketch chooses an action, and output pins send control signals. A motor driver supplies the current needed by motors. The screen below makes a simplified control loop visible.
From Blink to a robot control loop
Blink repeats an output pattern. It does not measure whether a goal was reached, so repetition alone is not feedback. A robot control loop reads a sensor, compares the measurement with a goal, acts, and reads again. Below, each loop pass runs those four lines in order — watch the highlighted line and the robot together.
Each square is one unit. The robot's sensor (front) measures its position, the orange and blue legs show the error on each axis, and the yellow arrow is the motor command.
Predict: if the target is to the left, should the x change be positive or negative?
// Pseudocode: needs sensors + a motor drivervoidloop() { position = readPositionSensors(); error = target - position; command = chooseMovement(error); sendToMotorDriver(command);}
Brain: sense & estimate
Your nervous system combines sensory information to guide movement. Place cells and grid cells contribute to spatial representation. Their activity is biological; this square grid is a teaching model, not a picture of those cells.
Math lens: position, patterns, measurement and uncertainty.
A controller compares a target with a measured position, then commands a motor. New measurements allow corrections. This is feedback control; a robot can use it without copying a brain.
Math lens: target − position = error. A movement rule turns that error into an action.
Graphics turns positions and shapes into an image. Here, x moves right and y moves up in our world; the drawing converts them into screen positions. More advanced rendering models cameras, materials and light. Vision works in the other direction: using images to infer a scene.
Math lens: coordinates, geometry, transformations and functions.
Neurons receive inputs, integrate them, and can send signals along an axon when conditions for an action potential are met. An Arduino reads electrical inputs and executes instructions. That input-to-output comparison is useful, but a neuron is not a tiny Arduino: biological signaling, timing, and learning work differently. Synapses can change strength through several mechanisms; repeated firing does not always strengthen them. Your Blink sketch does not learn, though a robot can be programmed with a learning algorithm.
Try three investigations: reach the first target; move it behind the robot and explain the negative error; then move it during a journey and explain why measuring again matters. The graphics is a view of the model, not a sensor reading from a physical Arduino.
Discuss: what happens if a sensor reports the wrong position? Our demo assumes perfect measurements and immediate motion. Real robots and nervous systems must handle noise, delay, and physical limits.
1. How many times does setup() run during normal operation?
2. In delay(1000), what does 1000 measure?
3. What does opening the Serial Monitor let you do?
4. What do a neuron and a microcontroller have in common?
Protect your build
3D Print a Robot Brain Enclosure
Keep your Arduino safe on the classroom bench or inside a robot chassis. Open Forge to design a 3D-printable electronics case with screw standoffs matching the Arduino Uno's mounting holes, openings for USB and power cables, and a drop-in ventilated lid.