~60 min. Install the Arduino IDE; connect your R4; upload the canonical Blink sketch; modify the blink rate.
Goal: get a working development environment; upload your first sketch; confirm the toolchain works end-to-end
Estimated time: 60 minutes (or longer if Windows driver issues bite)
Prerequisites: Arduino R4 from the Classroom Pack; USB cable; laptop with admin rights for IDE install
Steps
Step 1: Install the Arduino IDE (15 min)
Go to https://www.arduino.cc/en/software. Download the Arduino IDE 2.x for your OS. Install. Launch
If you are on Windows: the IDE may prompt to install USB drivers for the R4. Accept. Reboot if asked
Step 2: Connect the R4 (5 min)
Plug the USB cable into the R4 and into your laptop. The R4's power LED should light. Some R4 boards ship with a demo sketch pre-installed; you may see the built-in LED blinking already
Step 3: Select board and port in the IDE (10 min)
In the IDE: Tools → Board → Arduino UNO R4 Boards → Arduino UNO R4 Minima (or "R4 WiFi" if that is your variant). Tools → Port → pick the port that matches your R4 (Windows: COM3 / COM4 / etc; macOS: /dev/cu.usbmodem...; Linux: /dev/ttyACM0 or similar)
If you don't see a port: the USB drivers may not have installed. On Windows, check Device Manager for an unknown device. Reinstall drivers if needed
Step 4: Open and upload Blink (10 min)
File → Examples → 01.Basics → Blink. The sketch opens; it has a setup() and a loop(). Read it; the loop turns LED_BUILTIN on, delays 1 second, turns it off, delays 1 second
Click the right-arrow button (Upload). The IDE compiles and uploads. Watch the progress at the bottom of the IDE. On success: "Done uploading"
The built-in LED on your R4 should now blink: 1 second on, 1 second off, repeating
Step 5: Modify the rate (10 min)
In the Blink sketch, change the delay values. delay(100) for fast blink (10 Hz); delay(50) for very fast. Re-upload. Confirm the blink rate changes
At delays of ~10 ms or less, the eye sees a constant glow (just slightly dimmer than full); this is the start of the PWM concept you will revisit in week 10
Step 6: Save and document (10 min)
File → Save As. Save the sketch as blink-modified.ino to a folder you will use throughout HW-101 (e.g., ~/HW-101/sketches/)
In your lab notebook: record the delay values you tried and what you observed. Note the IDE version and your OS
Expected output
- Working Arduino IDE install
- R4 connected and recognized
- Modified blink sketch saved
- Built-in LED blinking at a rate you chose
Common pitfalls
- Windows USB driver not installing: download manually from arduino.cc if the IDE doesn't prompt. Search "Arduino UNO R4 driver Windows"
- macOS Gatekeeper blocking the IDE: System Settings → Privacy → allow Arduino IDE. May require multiple confirmations
- Linux serial port permissions: add your user to the
dialoutgroup:sudo usermod -a -G dialout $USER; log out and back in - Wrong board selected: if you pick "Arduino UNO" (the classic) instead of "Arduino UNO R4," compile may succeed but upload may fail. Confirm the board match
Stretch (optional)
- Modify the sketch to fade the LED on, hold, fade off, hold (using a series of delays and PWM). Preview of week 10
- Add Serial output: Serial.begin(9600) in setup(); Serial.println("blink!") on each toggle. Open Tools → Serial Monitor; set baud to 9600. Watch the messages
- Read the Blink sketch's source carefully. The pinMode call sets LED_BUILTIN to OUTPUT mode; you will do the same for any pin you want to drive
Lab 7.1 v0.1. The first lab where Arduino IDE meets hardware. Most students remember this moment for the rest of their lives.