Programming the Arduino
Getting started- My first project
Head on to the https://www.arduino.cc/ website and go to the ‘Documentation’ tab and click on ‘Getting started’. After this, scroll down and install the Arduino Desktop IDE for your OS.
On installing the IDE, connect the Arduino to your Desktop using the printer cable provided in the Arduino package. Under the ports of the Devices section of the Windows OS, COM3 should appear. If it does not appear, head over to https://www.driverscape.com/ and download the USB-SERIAL CH340 Drivers, as shown in the picture below. I had to do this as COM3 did not appear under my occupied ports. After this we can start programming our Arduino board. For my first project I used the onboard lights, and a simple program that turns them on and off after a set time limit.
In the IDE, I had to first choose the correct model of my board, which was the MEGA 2560. The board model is always displayed on the box of the Arduino. You can choose the board model you have by going on to the tools tab, as displayed in slide above.
We also need to make sure that the Arduino is connected from the correct port, which is the COM3 port (as shown in the slide above).
We can then open the Serial Monitor (in the slide above), which will display the output of the program that we will be executing display. For the program, I choose something quite simple and that was already inbuilt into the Arduino IDE. I proceeded in the sequence: File>>Examples>>0.1Basics>>Blink.
This window opens after clicking on Blink. To execute the program, we have to click on the arrow sign on the top left of the window. On execution the inbuilt red lights on the Arduino start to blink periodically, with user set time limits. We can also manipulate the time gap between each blink of the light by changing the numerical value between the brackets of the delay command.
To execute more complex programs we will need to learn some of the Arduino programming language references. The language is on display for free on the Arduino website, the links for which will be present under the Sources section of this blog post.
Sources:
Arduino IDE- https://www.arduino.cc/en/software
Arduino Programming Language- https://www.arduino.cc/reference/en/