Introduction to Arduino


What is Arduino?

Arduino uses a mix of circuitry and programming to create our system. There are many types of Arduino boards available in the market, such as the Uno, Due, Leonardo, Diecimila, Mega, Nano. Arduino uses the programming language of c++ as its basis. Most arduino codes that you might need are usually available online and free to copy if enough research is done.

The Process

The process of building your arduino code is very simple. You first start of with a demo sircuit and code on TinkerCAD. On this platform you can design your circuits and create your programme. Once everything works out on the platform, you can copy the code over to arduino.ide and upload it into your arduino board. You can then proceed to build your circuit based of your TinkerCAD design.

Arduino.ide

Arduino.ide is what we use to upload our programme to our board. To set it up for upload, we need to go to Tools > Serial Port > (select the available COM port). Afterward, we can verify and upload our programme.

void setup()

This block will only be run once. It is typically used to initiallise the necessary pins used in the programme.

void loop()

As said in the name, this block will keep running over and over again. This is mainly for input devices that are constantly awaiting for the right conditions to be met to execute a certain part of the programme.

pinMode

There are 3 types of pinMode available.

  • INPUT-digital input
  • INPUT_PULLUP-digital input using arduino's integrated resistor
  • OUTPUT-digital output, able to source up to 40mA per pin, total of 200mA per chip