Voidloop() {
Serial.begin(9600);
}
Void.loop() {
Serial.printIn ("ello dear");
It will print out "ello dear" over and over again because its in the loop.
Instruction must be verified by clicking the arrow key
then select board your using in tools/board.
Select correct serial port (USB) before uploading.
The serial monitor will show message.
That done.... now to turn LED light on/off
When setting up your circuit remember, electricity flows in one direction only.
Arduino sends out 5 volts of electricity which has to be grounded.
The LED light has one leg shorter than the other, short/GND and long/13.
13 has to be made into an output pin.
ie put in code
PinMode(13, OUTPUT);
In the loop function, tell light to turn on/off
Void loop (){
Serial.print In ("ello dear");
Digital write (13 HIGH);
Digital write (13 LOW);
The LED has resistance that will reduce voltage.
You have to calculate this when setting up your board.
This is called a breadboard.
Using it allow you to work out a circuit without having to use a solder.
The power supply comes from the arduino.
A resistor before the LED will reduce voltage going to the LED light.
void setup () {
serial.begin (9600);
void loop () {
analog Read (0);
}
Serial.printIn (analogRead(0));
This reads the amount of voltage going to the board.
The serial monitor shows the number which represents the amount of light it can service.
If you cover the light the number (which is determined by the arduino) goes down.
No comments:
Post a Comment