8. Input/Output devices¶
This week I worked with the Arduino Nano but this time uitlizing the breadboard with input and output devices to achieve specific results coded within the Arduino IDE.
Getting used to Breadboards!¶
Breadboard is a way of constructing electronics without having to use a soldering iron. Components are pushed into the sockets on the breadboard and then extra ‘jumper’ wires are used to make connections.
The middle section of the board has two columns, each with 30 strips of connector, like the one pulled out and to the side of the breadboard. These connect together anything that is pushed through from the front into one of those five holes.
On either edge of the board are much longer sections of clip that join together the columns of holes marked by the blue and red lines on the front of the breadboard. These are generally used for GND (blue) and 5V (red).
Getting Started with Input/Output Devices on Arduino¶
The functioning of a computer system is based on the combined usage of both input and output devices. Using an input device we can give instructions to the computer to perform an action and the device reverts to our action through an output device.
Input Device Definition: A piece of equipment/hardware which helps us enter data into a computer is called an input device.
Output Device Definition: A piece of equipment/hardware which gives out the result of the entered input, once it is processed (i.e. converts data from machine language to a human-understandable language), is called an output device.
Many microcontroller projects require some form of user-input, like a button press, and produce some output to inform the user of the device’s current state or errors. Inputs are often simple components such as push-buttons, switches, and dials. Users can utilize LEDs as simple output devices.
Implementing functions with the I/O devices!¶
During this week, we worked with the Servo Motor and the Piezzo Buzzer
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
digitalWrite(LED_BUILTIN, HIGH); // turn the LED on (HIGH is the voltage level)
delay(1000); // wait for a second
digitalWrite(LED_BUILTIN, LOW); // turn the LED off by making the voltage LOW
delay(1000); // wait for a second
}