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

View File

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