006 - Arduino (Simulation-1)
006 - Arduino (Simulation-1)
visitor2
Password: Monday55
123dcircuits.io
Microcontrollers
(Arduino )
Inputs
and Ou
tputs (
IO)
PWR IN
USB / Power
(to Computer)
RESET
SCL\SDA
(I2C Bus)
POWER
5V / 3.3V / GND
Digital I\O
PWM(3, 5, 6, 9, 10, 11)
Analog
INPUTS
What's
on-boa
rd
Serial
transmission
Quartz Crystal
Analog
Reference
(0 to 5v)
& Ground
Onboard
LED (pin 13)
Tx/Rx
LEDs
~ PWM I\O
(3, 5, 6, 9, 10, 11)
ATMEGA
Microcontroller
Hello world
LED ON
LED OFF
LED ON
LED OFF
delay(1000);
digitalWrite(13, LOW);
making the
delay(1000);
}
Blink Code
delay(1000);
digitalWrite(13, LOW);
level)
LOW
delay(1000);
}
#include <Servo.h>
Servo myservo;
int pos = 0;
void setup()
{
myservo.attach(9);
// attaches the servo on pin 9 to the
servo object
Serial.begin(9600);
// set up Serial library at 9600 bps
Serial.println("Hello servo! Position is at "); // prints hello with ending line
break
Serial.println(pos);
// prints hello with ending line break
delay(3000);
// waits 15ms for the servo to reach the
position
}
void loop()
{
for(pos = 45; pos < 145; pos += 1)
// goes from 0 degrees to 180
degrees
{
// in steps of 1 degree
myservo.write(pos);
// tell servo to go to position in
variable 'pos'
Serial.print("Fwd servo is at! "); // prints hello with ending line break
Serial.println(pos);
// prints hello with ending line break
delay(500);
// waits 15ms for the servo to
reach the position
}
for(pos = 145; pos>=45; pos-= 1)
// goes from 180 degrees to 0
degrees
{
myservo.write(pos);
// tell servo to go to position in
variable 'pos'
Serial.print("Rev servo is at! ");
// prints hello with ending line
break
Serial.println(pos);
// prints hello with ending line break
delay(50);
// waits 15ms for the servo to