1. Keyboard INPUT using the ASCII table So far, we have experimented with OUTPUTs that send out signals from Galileo. From now on, we will do lab with INPUTs that receive entry of data. Keyboard is just one of them.
Go to the IDE’s ‘File’ menu and select ‘Example’. In the section ‘08. Strings,’ click ‘Character Analysis’ and you will see a new sketch screen.
Click the ‘Upload’ icon and check the message ‘Transfer complete’. There is a “Serial monitor” icon on the top right of your screen. Click on it. Type in ‘k’ and ‘7’. Next, type in the special character “@” and look through the new screen. You can see the ASCII value of each key on keyboard through the function ‘serial.read()’ from the Sketch.
ASCII code table is a table for expressing letters in numbers. It is used for computer or telecommunications by defining each letter that corresponds to the decimal number 0-127. To check the ASCII code table by Sketch, click the menu “File”, “Example” and “ASCIITable” in order listed.
2. Try Digital Input with the Pushbutton Digital is a technology used to express all the information in a series of digits 0 and 1. ‘0’ is called “Low” and ‘1’ is called “High”. The simplest experimentation of digital Input using the “Breadboard” is “Push button” or “Switch”.
▲ circuit diagram Stick the “Push button” above the “Breadboard”. In the case of “Push button,” you should be aware that two pins are connected together as a pair.
Of the pins that are not connected to each other, connect one to the Galileo’s 5V using a “jumper wire”. The other pin needs to connect to two ways at the same time. First, connect to Galileo’s digital pin #2 using another “jumper wire”. Next, connect to Galileo’s GND through 1KΩ resistance..
The 1KΩ resistance used in this lab is called the “Pull-down resistor”. It may seem like it becomes “High” when you press the “Push button” and “Low” when you take it off without pull-down resistor. However, actually, without the “Pull-down resistor”, it becomes very unstable. We call this state as ”Floating” and you must avoid it
. Click the IDE “file” menu and select “Example”, then click “02. Digital” and “Button” one at a time. In the new Sketch screen, press “Upload” icon. Continue to press and release the “Push button” and you will observe the reaction of the LED on the Galileo. The “digitalRead()” function in the Sketch is to receive Input of the “Push button”.
3. Lab with Analog Inputs Using the potentiometer What do you thinks is the principle of controlling the speaker’s volume? In fact, the speaker uses the “potentiometer”. Galileo interprets the Inputs of the “potentiometer” as analog signals.
▲ circuit diagram Put a “potentiometer” on the “Breadboard”. Then, use a “jumper wire” to connect one side to the potentiometer’s middle pin, and the other to the Galileo’s A0 pin. The remaining two pins of potentiometer should be connected to the Galileo board’s 5V pin and GND pin using other jumper wires.
In the Galileo board, there is an electronic device called ADC which converts the analog value of 0 to 5 volts to digital value of 0 to 1023. Because the CPU that is the brain of Galileo can be recognized the digital values.
Again, in order to receive power from the Galileo like, please remove the jumper portion of [IOREF] like photo.
Go to the “File” menu, select “Example” and click the “AnalogInput” which is under the “03. Analog” file. Click “Upload” button in the new Sketch screen. If you slowly turn the handle of the ““potentiometer”, you will see the changing speed of blinking LED on the Galileo. The “analogRead()” function of the Sketch receiver Inputs from the potentiometer.
4. Understanding of the Sensor and a lab with a light Sensor An electronic sensor such as the light sensor is a sensor that tells something about its environment by creating an electrical signal. Using the potentiometer, you can control the
brightness of the LED. This time we will experiment with reaction of a light sensor to the surrounding environment, not controlled by human. Galileo reacts to the degree of its surrounding brightness.
▲ circuit diagram Use the same jumper wires connected to the Galileo as they are. Now, replace the potentiometer with a light sensor on the “Breadboard”.
Connect the jumper wires to VCC and GND of the light sensor with the Galileo’s 5V pin and GND pin respectively. The jumper wire of Galileo’s A0 pin should be connected to the OUT pin of the light sensor.
There is no source code for this experiment in the IDE’s “Example”. So, you need to download the “LIGHTSENSOR.ino” file from the home page.
Select IDE’s “File” menu and “Open”, and then search for the “LIGHTSENSOR.ino” file in NUC. And click ‘OK’ button. Then you can see a message like next photo.