mirror of
https://github.com/platformio/platformio-core.git
synced 2025-10-04 17:40:57 +02:00
Re-group examples
This commit is contained in:
21
examples/atmelavr-and-arduino/adafruit-blink/README.rst
Normal file
21
examples/atmelavr-and-arduino/adafruit-blink/README.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
How to buid PlatformIO based project
|
||||
====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/ivankravets/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/atmelavr-and-arduino/adafruit-blink
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
33
examples/atmelavr-and-arduino/adafruit-blink/platformio.ini
Normal file
33
examples/atmelavr-and-arduino/adafruit-blink/platformio.ini
Normal file
@@ -0,0 +1,33 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:flora8]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = flora8
|
||||
|
||||
[env:trinket3]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = trinket3
|
||||
|
||||
[env:protrinket5]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = protrinket5
|
33
examples/atmelavr-and-arduino/adafruit-blink/src/Blink.pde
Normal file
33
examples/atmelavr-and-arduino/adafruit-blink/src/Blink.pde
Normal file
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
Blink
|
||||
Turns on an LED on for one second, then off for one second, repeatedly.
|
||||
|
||||
This example code is in the public domain.
|
||||
|
||||
To upload to your Gemma or Trinket:
|
||||
1) Select the proper board from the Tools->Board Menu
|
||||
2) Select USBtinyISP from the Tools->Programmer
|
||||
3) Plug in the Gemma/Trinket, make sure you see the green LED lit
|
||||
4) For windows, install the USBtiny drivers
|
||||
5) Press the button on the Gemma/Trinket - verify you see
|
||||
the red LED pulse. This means it is ready to receive data
|
||||
6) Click the upload button above within 10 seconds
|
||||
*/
|
||||
|
||||
int led = 1; // blink 'digital' pin 1 - AKA the built in red LED
|
||||
|
||||
// the setup routine runs once when you press reset:
|
||||
void setup() {
|
||||
// initialize the digital pin as an output.
|
||||
pinMode(led, OUTPUT);
|
||||
|
||||
}
|
||||
|
||||
// the loop routine runs over and over again forever:
|
||||
void loop() {
|
||||
digitalWrite(led, HIGH);
|
||||
delay(1000);
|
||||
digitalWrite(led, LOW);
|
||||
delay(1000);
|
||||
}
|
||||
|
Reference in New Issue
Block a user