The following information is a single lesson in a larger project. Find more great projects here.
In this project, you can use your Arduino to control your computer! You will take full advantage of the serial communication between the Arduino and your computer to change the color of an Arduino logo. This project requires your physical Arduino kit.
Step 1: Project Description
In this project, you are going to take control of your computer with your Arduino! Or at least you will take control of one application.
When you program your Arduino, you're opening a connection between the computer and microcontroller through a serial port. You can use this connection to send data back and forth to Arduino IDE, or to other applications.
You will be using a very simple interface - a single potentiometer - to control the color of the Arduino logo, shown above.
You'll program the Arduino to communicate data from the pot through the serial port. Then you will use another programming environment called Processing to tell your computer what to do with the collected data.
Continue to the next step.
Step 2: Bill of Materials
Since this project relies on another programming environment called Processing to work, you won't be able to prototype the project in the simulator. You will need to use your Arduino kit to build the full project!
You will need one potentiometer, your Arudino Uno, and a breadboard to complete the project.
- Continue to the next step.
Step 3: Serial Communication
The Arduino has a chip that converts the computer’s USB-based communication to the serial communication the Arduino uses. Serial communication means that your Arduino and computer are exchanging bits of information serially, or alternating one after the other.
When communicating serially, computers need to agree on the speed that they talk to one another. You’ve probably noticed when using the serial monitor there’s a number at the bottom right corner of the window, like the picture below. That number is 9600 bits per second (or baud). It's the same as the value you usually declare usingSerial.begin().
- Continue to the next step.
- Stuck? HINT: A bit is the smallest amount of information a computer can understand.
Step 4: Download Processing
You'll be using a programming environment called Processing to write code that interprets the serial data coming from the Arduino, and translate it to take action on your computer: changing the color of a picture!
Arduino’s programming environment is actually based on Processing’s. They look pretty similar, so you should feel right at home there!
- Before getting started with the project, download the latest version of Processing from processing.org
- It may be helpful to look at the "Getting Started" and "Overview" tutorials at processing.org/learning, but you can also simply use the instructions in this project.
- Continue to the next lesson to learn how to assemble the simple pot circuit.
Next Lesson:Setting Up the Circuit
We have a be nice policy.
Please be positive and constructive.