0

members

Easy Basics Project 001 Make your board blink from the browser

of Arduino (Not selected)

Basics: Project 001

Project name: Make your board blink from the browser

Attachments: blink.zip

Now that you’ve set up your online IDE, let’s make sure your computer can talk to the board; it’s time to make sure you can upload a program.

  • Double check if the Web Editor is displayed the way you like, check the Preferences panel for a few options
  • Connect your Arduino or Genuino board to your computer. Boards and serial ports are auto-discovered and selectable in a single dropdown. Pick the Arduino/Genuino board you want to upload to from the list.
  • Let’s try an example: Choose ‘Examples’ on the menu on the left, then ‘Basic’ and ‘Blink’. The Blink sketch is now displayed in the code area.
  • To upload it to your board, press the ‘Upload’ button (arrow right) near the dropdown. A ‘BUSY’ label replaces the buttons during code verifying and uploading. If the upload is successful, the message “Success: Done uploading” will appear in the bottom output area.
  • Once the upload is complete, you should then see on your board the yellow LED with an L next to it start blinking. If this is the case congratulations! You have successfully programmed your board to blink its on-board LED!

  • Sometimes your brand new Arduino/Genuino is already programmed with the Blink sketch, so you can’t tell if you are truly in control. If this is the case, change the delay time by changing the number in the parenthesis to 100, and upload the Blink sketch again. Now the LED should blink much faster. Congratulations! You really are in control!

Programme:

/*  Blink  Turns on an LED on for one second, then off for one second, repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO it is attached to digital pin 13, on MKR1000 on pin 6. LED_BUILTIN takes care of use the correct LED pin whatever is the board used. If you want to know what pin the on-board LED is connected to on your Arduino model, check the Technical Specs of your board at https://www.arduino.cc/en/Main/Products

This example code is in the public domain.

modified 8 May 2014 by Scott Fitzgerald

modified 2 Sep 2016 by Arturo Guadalupi*/

// the setup function runs once when you press reset or power the board

void setup() { 

// initialize digital pin LED_BUILTIN as an output.  pinMode(LED_BUILTIN, OUTPUT);

}

// the loop function runs over and over again forever

void loop() {  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level) 

delay(1000);                       // wait for a second  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW  delay(1000);                       // wait for a second

}

Article is based on information from adruino.cc. The text of the Arduino getting started guide is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the guide are released into the public domain.



Other projects of Arduino

« Go back to category
Is this project fake? Report it!   
Recommend to a friend
Published at 27-04-2017
Viewed: 410 times