Experiment - 2
Experiment - 2
Aim
To study pinMode Arduino Command (digitalWrite).
Theory
syntax for our pinMode Arduino command: pinMode(pin#, mode);
The pinMode defines the Arduino Pins, if they are used as an input or output. There are three
types of modes that can be assigned to pins of Arduino, which are: OUTPUT, INPUT,
INPUT_PULLUP.
int led=13;
void setup ()
ARDUINO UNO V3
{
pinMode(13, OUTPUT);
RESISTOR
}
Reset
USB
13
PB5/SCK
12
PB4/MISO
11
void loop () ~ PB3/MOSI/OC2A 220
ARDUINO
10
~ PB2/OC1B
9
~ PB1/OC1A
8
{
ATMEGA328P-PU
PB0/ICP1/CLKO
LED-GREEN
1121
7
PD7/AIN1 6
digitalWrite(13, HIGH); A0
PC0/ADC0
~ PD7/AIN1
~ PD5/T1/OC0B
5
A1 4
PC1/ADC1 PD4/T0/XCK
A2 3
delay (1000); A3
A4
PC2/ADC2
PC3/ADC3
~ PD3/INT1/OC2B
PD2/INT0
2
PC4/ADC4/SDA 1
PD1/TXD
A5 0
PC5/ADC5/SCL PD0/RXD
digitalWrite(13, LOW); by TEP
delay (1000);
}
Figure 1. Source Code Figure 2. Circuit diagram
Procedure
1. To download and installed Arduino IDE software which write C programming language.
2. To download and installed Proteus software which simulate the hardware components.
3. To add Arduino Library to Proteus software.
4. To draw circuit diagram on Proteus software.
5. To write the source code on Arduino IDE software.
6. To verify the source code and add hex file to upload hex file on Proteus software.
7. To run the connecting components.
8. To investigate the circuit how to stimulate the system.