Update Wiring example according to Get-Started on home page

This commit is contained in:
Ivan Kravets
2015-12-26 20:08:50 +02:00
parent 9312ca7f0d
commit f7311eb94d
2 changed files with 28 additions and 27 deletions

View File

@ -1,15 +1,17 @@
;
; Project Configuration File
;
; A detailed documentation with the EXAMPLES is located here:
; http://docs.platformio.org/en/latest/projectconf.html
;
; Docs: http://docs.platformio.org/en/latest/projectconf.html
[env:uno]
platform = atmelavr
framework = arduino
board = uno
[env:nodemcu]
platform = espressif
framework = arduino
board = nodemcu
build_flags = -D LED_BUILTIN=BUILTIN_LED
[env:teensy31]
platform = teensy
framework = arduino
@ -19,9 +21,4 @@ board = teensy31
platform = timsp430
framework = energia
board = lpmsp430g2553
[env:lptm4c1230c3pm]
platform = titiva
framework = energia
board = lptm4c1230c3pm
build_flags = -DLED_PIN=GREEN_LED
build_flags = -D LED_BUILTIN=RED_LED

View File

@ -1,21 +1,25 @@
#ifdef ENERGIA
#include "Energia.h"
#else
#include "Arduino.h"
#endif
/*
* Blink
* Turns on an LED on for one second,
* then off for one second, repeatedly.
*/
#ifndef LED_PIN
// Most Arduino boards already have a LED attached to pin 13 on the board itself
#define LED_PIN 13
#endif
#include "Arduino.h"
void setup() {
pinMode(LED_PIN, OUTPUT); // set pin as output
void setup()
{
// initialize digital pin 13 as an output.
pinMode(LED_BUILTIN, OUTPUT);
}
void loop() {
digitalWrite(LED_PIN, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(LED_PIN, LOW); // set the LED off
delay(1000); // wait for a second
void loop()
{
// turn the LED on (HIGH is the voltage level)
digitalWrite(LED_BUILTIN, HIGH);
// wait for a second
delay(1000);
// turn the LED off by making the voltage LOW
digitalWrite(LED_BUILTIN, LOW);
// wait for a second
delay(1000);
}