This project belongs to the series of "Fun Learning with Sumo Robot", this topic focuses on making the basic toolchain working with the Nano board that is used by the example Sumo Robot. Goals:
Get to know and experience the tiny Nano board
Fix basic toolchain issues with the development, prepare for next step integration with the sensors and actuators
Practice for-looping and serial communication
START A BIT > Projects Library > This page
[ ] Simple: 30-60 minutes
[x] Moderate: 1-2 hours
[ ] Challenging: more than 2 hours
The estimation bases on average situation without unexpected troubleshooting, assuming that the student meets prerequisites. It only indicates rough time needed to complete this project, but not about technical difficulty, not covering discussion and sharing time.
Experience with Arduino UNO and basic programming skills, preferably participated LP2508: Starting Experience of C++ with Arduino, 25w08
Purpose: A self study topic, find out the difference of UNO vs NANO, and share the knowledge
❓Explore by yourself:
What is Arduino Nano?
What is "Clone Nano"?
Are there many different variants of Nano?
What differences between Nano and UNO?
What could we use Nano for?
Purpose: First step to try and fix possible connection and USB driver issues, especially for those who work in Windows
For Windows users, Arduino IDE or Arduino Cloud Editor might not pop up a recognized Nano board, this is common issue for a "Clone Nano" with Windows.
MacOS and Chromebook mostly work well directly.
If you meet above problem in Windows, download VCP Drivers from https://ftdichip.com/drivers/vcp-drivers/, the downloaded file is CDM2123620_Setup.zip, unzip it, run CDM2123620_Setup.exe
After VCP driver installation, unplug and plugin Nano USB again, there will be this item in Device Manager, no more unknown item under "Other devices"
Ports (COM & LPT)
└─ USB Serial Port (COMx)
Now, go back to Arduino IDE or Arduino Cloud Editor to select the board by the recognized port. But the board type name remains unknown, need to manually select the board type to be Arduino Nano.
Err message like this tells that other process is using the same port, mostly often it's due to
Serial Monitor
Arduino Cloud Editor
Serial Monitor from Arduino Cloud
Close other other application or process that use the same port and retry.
Error: cannot open port \\.\COM3: Access is denied.
Error: unable to open port COM3 for programmer arduino
Failed uploading: uploading error: exit status 1
Purpose: Build a dummy sketch and download the build to Nano board for the first time to ensure the toolchain works well
In Arduino IDE or Arduino Cloud Editor:
Try a simple sketch to print hello word via serial
void setup() {
Serial.begin(9600);
Serial.println("Hello Nano!");
}
void loop() {
}
Purpose: Build a dummy sketch and download the build to Nano board for the first time to ensure the toolchain works well
Challenge 1
* * * * *
* * * * *
* * * * *
* * * * *
* * * * *
Challenge 2
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
* * * * * * * * * *
Challenge 3
*
* *
* * *
* * * *
* * * * *
Challenge 4
*
* * *
* * * * *
* * *
*
⁉️Challenge: Can you use for-loop to refine this program? And print a 10x10 start array!
void setup() {
Serial.begin(9600);
Serial.println("* * * * *");
Serial.println("* * * * *");
Serial.println("* * * * *");
Serial.println("* * * * *");
Serial.println("* * * * *");
Serial.println("");
}
void loop() {
}
void setup() {
Serial.begin(9600);
for (int row = 0; row < 5; row++) {
for (int col = 0; col < 5; col++) {
Serial.print("* ");
}
Serial.println();
}
Serial.println();
}
void loop() {
}
⁉️Challenge: Can you print a growing star triangle? How about program using for-loops?
void setup() {
Serial.begin(9600);
for (int row = 1; row <= 5; row++) {
for (int col = 0; col < row; col++) {
Serial.print("* ");
}
Serial.println();
}
}
void loop() {
}
Purpose: A little more fun testing Nano and recap the digital output functions
Nano has also a built-in LED, just like UNO, and its pin is also 13.
You can use 13 explicitly, or use a macro LED_BUILTIN for this pin.
void setup() {
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // LED ON
delay(500);
digitalWrite(13, LOW); // LED OFF
delay(500);
}
⁉️Challenge: Build a police car's flash light using 2 external LEDs? Try different patterns of alarming for different levels of urgency, like real police car lights.
void setup() {
pinMode(2, OUTPUT);
pinMode(3, OUTPUT);
}
void loop() {
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
delay(500);
digitalWrite(2, LOW);
digitalWrite(3, HIGH);
delay(500);
}
#define BLUE_LED 2
#define RED_LED 3
void setup() {
pinMode(BLUE_LED, OUTPUT);
pinMode(RED_LED, OUTPUT);
}
void loop() {
for (int i = 0; i < 5; i++) {
digitalWrite(BLUE_LED, HIGH);
digitalWrite(RED_LED, LOW);
delay(150);
digitalWrite(BLUE_LED, LOW);
digitalWrite(RED_LED, HIGH);
delay(150);
}
// Pause
digitalWrite(BLUE_LED, LOW);
digitalWrite(RED_LED, LOW);
delay(2000);
}
Purpose: Enhance basic knowledge understanding, reflect and summarize what we have learnt
What is the difference between UNO and NANO?
Why do we use NANO?
Take 1-2 minutes to explore anything on the tools and the making flow, with curiosity, no matter how much prior knowledge you have, you should make
At least 1 interesting finding
At least 1 curious question