Thread Rating:
  • 5 Vote(s) - 4.2 Average
  • 1
  • 2
  • 3
  • 4
  • 5

WeatherDuino Pro2 'PLUS' Build
#14

Now we need to program the Arduino Mega 2560 module with a simply program to test it out and confirm that it is functioning correctly.  The Arduino modules have an onboard LED which is connected to digital pin 13 and this is convenient for testing our module.  In the IDE software (editor) the lower section is where you write your sketch or program, before uploading it into your Arduino Mega 2560 module.

   

The following program, or “sketch” as we call it will blink the onboard LED.  You need to copy this sketch into the IDE editor software, overwriting any existing text (or program lines).  Highlight the following lines of code, including the first “/*” and down to and including the last “}” symbol, then press CTRL-C on your keyboard to ‘copy’ it into the buffer (memory) on your computer. 


Code:
/*
This sketch blinks the onboard LED repeatedly.
Most Arduinos have an on-board LED you can control. On the UNO, MEGA and ZERO
it is attached to digital pin 13. LED_BUILTIN is set to
the correct LED pin independent of which board is 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
*/
// 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(550);                       // wait for a second
digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
delay(300);                       // wait for a second
}



Now go to your IDE program, and highlight the existing 'default' lines of code:

   

And then press CTRL-V on your keyboard to past the new lines of code from the computers buffer (memory) into the IDE editor.  If all goes well, you should see the new 'test' sketch in your IDE editor as shown below.

   
Reply


Messages In This Thread
WeatherDuino Pro2 'PLUS' Build - by Wizza - 01-01-2017, 07:04
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 01-01-2017, 07:54
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 01-01-2017, 07:56
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 01-01-2017, 08:15
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 01-01-2017, 08:35
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 01-01-2017, 08:44
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 01-01-2017, 10:22
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 01-01-2017, 12:14
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 01-01-2017, 22:20
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 02-01-2017, 00:29
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 02-01-2017, 02:15
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 18-01-2017, 10:37
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 18-01-2017, 11:57
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 18-01-2017, 12:01
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 18-01-2017, 12:03
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 18-01-2017, 12:19
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 18-01-2017, 12:20
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 19-01-2017, 10:09
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 19-01-2017, 11:01
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 19-01-2017, 11:59
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 19-01-2017, 12:03
RE: WeatherDuino Pro2 'PLUS' Build - by hornychz - 19-01-2017, 22:47
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 21-01-2017, 12:10
RE: WeatherDuino Pro2 'PLUS' Build - by AllanG - 21-01-2017, 13:22
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 21-01-2017, 20:19
RE: WeatherDuino Pro2 'PLUS' Build - by AllanG - 21-01-2017, 22:02
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 22-01-2017, 03:44
RE: WeatherDuino Pro2 'PLUS' Build - by AllanG - 22-01-2017, 13:36
RE: WeatherDuino Pro2 'PLUS' Build - by Zack_ster - 23-01-2017, 11:29
RE: WeatherDuino Pro2 'PLUS' Build - by AllanG - 24-01-2017, 13:20
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 22-01-2017, 07:45
RE: WeatherDuino Pro2 'PLUS' Build - by AllanG - 22-01-2017, 13:31
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 21-01-2017, 21:15
RE: WeatherDuino Pro2 'PLUS' Build - by Barrow4491 - 22-01-2017, 02:31
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 22-01-2017, 04:47
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 22-01-2017, 08:17
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 22-01-2017, 21:46
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 23-01-2017, 11:13
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 23-01-2017, 11:30
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 23-01-2017, 12:06
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 24-01-2017, 11:27
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 24-01-2017, 11:39
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 26-01-2017, 02:16
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 26-01-2017, 02:27
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 26-01-2017, 02:38
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 26-01-2017, 02:53
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 26-01-2017, 03:02
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 06-02-2017, 10:31
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 06-02-2017, 10:34
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 06-02-2017, 10:39
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 06-02-2017, 10:42
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 06-02-2017, 10:44
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 07-02-2017, 10:32
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 07-02-2017, 10:40
RE: WeatherDuino Pro2 'PLUS' Build - by Wizza - 09-02-2017, 21:57
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 09-02-2017, 23:58
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 10-02-2017, 12:06
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 10-02-2017, 12:07
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 10-02-2017, 19:33
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 11-02-2017, 01:25
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 11-02-2017, 04:15
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 11-02-2017, 04:21
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 11-02-2017, 09:24
RE: WeatherDuino Pro2 'PLUS' Build - by uncle_bob - 11-02-2017, 10:54
RE: WeatherDuino Pro2 'PLUS' Build - by markkkk42 - 11-02-2017, 11:03
RE: WeatherDuino Pro2 'PLUS' Build - by hornychz - 24-02-2017, 09:49
RE: WeatherDuino Pro2 'PLUS' Build - by werk_ag - 24-02-2017, 23:48
RE: WeatherDuino Pro2 'PLUS' Build - by hornychz - 24-02-2017, 09:51
RE: WeatherDuino Pro2 'PLUS' Build - by zitoune - 24-02-2017, 17:44



Users browsing this thread: 1 Guest(s)