Department of Electromechanical Engineering Workshop For Mechatronics
Department of Electromechanical Engineering Workshop For Mechatronics
1/8
Programming Overview
1 Introduction
2 Minimum Code
3 Important Commands
4 Libraries
2/8
Introduction
Introduction
Arduino is a prototype platform (open-source) based on an easy-to-
use hardware and software. It consists of a circuit board, which can
be programed (referred to as a microcontroller) and a ready-made
software called Arduino IDE (Integrated Development Environment),
which is used to write and upload the computer code to the physical
board.
3/8
Minimum Code
Minimum Code
4/8
Minimum Code
PinMode
A pin on arduino can be set as input or output by using pinMode
function.
pinMode(13, OUTPUT); // sets pin 13 as output pin
pinMode(13, INPUT); // sets pin 13 as input pin
5/8
Important Commands
Important Commands
delay(ms): pauses the program for the amount of time (in millisec-
ond)specified as parameter.
The code pauses the program for one second before toggling the
output
7/8
Libraries
8/8