Lab-1 Arduino PDF
Lab-1 Arduino PDF
Reset Button
Power LED
USB
Microcontroller
Power Plug
PWM: 3, 5, 6, 9, 10, and 11. Provide 8-bit PWM output with the analogWrite() function.
LED: 13. There is a built-in LED connected to digital pin 13.
EEE F411, IoT course, Dr. Vinay Chamola, BITS-Pilani 11
Download Arduino IDE
http://www.arduino.cc/download
if (condition)
{
// do something here
}
goto label;
bailout:
analogWrite(PWMpin, x);
delay(50);
}
= (assignment operator)
+ (addition)
- (subtraction)
* (multiplication)
/ (division)
% (modulo)
== (equal to)
!= (not equal to)
< (less than)
> (greater than)
<= (less than or equal to)
>= (greater than or equal to)
{
if (analogRead(0) > 400) {
return 1;
else{
return 0;
}
}
#include <Wire.h>
Anode + Cathode -
Cathode - Anode +
Press to Turn On
Release to Turn Off
Variable Resistor
R= 5V/0.02A= 250Ω
pinMode(pin, INPUT/OUTPUT)
Eg
digitalWrite(9,HIGH)
Syntax
delay(ms)