Today I am going to explain to you about Arduino programing code.
Arduino is a tool for making computers that can sense and control more of the physical world than your desktop computer. It’s an open-source physical computing platform based on a simple microcontroller board, and a development environment for writing software for the board. We used this to program our digital poetry project.
In the first line of this picture it says #include<wire.h>.
Include means to add existing code to your program. This wire.h is for I2C. I2C is a way to make two electronic devices communicate. In our program, this code is the way for the Arduino to talk to the chip.
“Int” is a primary data-type for number storage. It’s tells you in which pin number the electronics devices have to be. For example: Int button-pin=2; It means that the Button is attached to pin #2.
Boolean reset is a variable that is true or false. In this picture the boolean reset is false. Serial.begin is to sets the data rate in bits per second (baud) for serial data transmission for communicating with the computer The output goes to the multiplex to tell it which number to start with. A multiplexer can hold 16 input and also it goes to #A4 in the Arduino.
(pinMode Input) means to set the digital pin as an Input. INPUT is a potentiometer is a simple knob that provides a variable resistance, which you can read into the Arduino board as an analog value.and ( pinMode OUTPUT) is to set the digital pin as Output. Sometimes if something is happening in Arduino that is causing to much problems we use Delay to tell the computer to wait for some second or minute. in the Serial print mean to send words or numbers to Arduino and put it in the screen. In our project programing the serial print is(push button to read poem) the computer tells you to press the button to read the words in the poem. If you press the button, the words in the poem will come out in the screen.
This code is about the words.
Void loop is a part of the arduino that repeat over and over again.
In the first picture it says (reset= false) but now it’s says (reset = true). Reset means to set something again, to restart. which means first the loop was false but now it reset false to true.
string means a bunch of letters. (//array) of string is the one that will hold the poem. (int channel=0) int channel is the number of the multiplexer connection. Like in this code, the multiplexer hold 16 input. The arduino can not read all those input in the same times, in order for the arduino to read all the words it tells the int channel which input it want to read first, second etc… And remember computer words always start with 0.