mirror of
https://github.com/platformio/platformio-core.git
synced 2025-07-29 17:47:14 +02:00
Re-structure "atmelavr-and-arduino" examples
This commit is contained in:
9
.gitmodules
vendored
9
.gitmodules
vendored
@ -1,3 +1,6 @@
|
||||
[submodule "examples/atmelavr-and-arduino/arduino-adafruit-library/lib/Adafruit_CC3000_Library"]
|
||||
path = examples/atmelavr-and-arduino/arduino-adafruit-library/lib/Adafruit_CC3000_Library
|
||||
url = https://github.com/adafruit/Adafruit_CC3000_Library.git
|
||||
[submodule "examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library"]
|
||||
path = examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library
|
||||
url = https://github.com/adafruit/Adafruit-PCD8544-Nokia-5110-LCD-library.git
|
||||
[submodule "examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library"]
|
||||
path = examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-GFX-Library
|
||||
url = https://github.com/adafruit/Adafruit-GFX-Library.git
|
||||
|
@ -1,84 +0,0 @@
|
||||
Arduino Example: Build \*.ino file with external Adafruit library
|
||||
=================================================================
|
||||
|
||||
1. Download ``platformio``
|
||||
`sources <https://github.com/ivankravets/platformio/archive/develop.zip>`_
|
||||
2. Extract ZIP archive
|
||||
3. Then run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/atmelavr-and-arduino/arduino-adafruit-library
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
||||
Console Output
|
||||
--------------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
> cd examples/atmelavr-and-arduino/arduino-adafruit-library
|
||||
(arduino-adafruit-library) > platformio run
|
||||
Processing arduino_uno environment:
|
||||
avr-g++ -o .pioenvs/arduino_uno/src/EchoServer.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/src/EchoServer.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/SPI/SPI.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/SPI/SPI.cpp
|
||||
avr-ar rcs .pioenvs/arduino_uno/libSPI.a .pioenvs/arduino_uno/SPI/SPI.o
|
||||
avr-ranlib .pioenvs/arduino_uno/libSPI.a
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000_Server.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000_Server.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/ccspi.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/ccspi.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/cc3000_common.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/cc3000_common.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/debug.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/debug.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/evnt_handler.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/evnt_handler.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/hci.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/hci.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/netapp.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/netapp.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/nvmem.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/nvmem.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/security.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/security.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/sntp.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/sntp.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/socket.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/socket.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/wlan.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant -I.pioenvs/arduino_uno/Adafruit_CC3000_Library -I.pioenvs/arduino_uno/SPI -I.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/wlan.cpp
|
||||
avr-ar rcs .pioenvs/arduino_uno/libAdafruit_CC3000_Library.a .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000_Server.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/ccspi.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/cc3000_common.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/debug.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/evnt_handler.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/hci.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/netapp.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/nvmem.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/security.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/sntp.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/socket.o .pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/wlan.o
|
||||
avr-ranlib .pioenvs/arduino_uno/libAdafruit_CC3000_Library.a
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/WInterrupts.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/WInterrupts.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/hooks.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/hooks.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/wiring.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/wiring.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/wiring_analog.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/wiring_analog.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/wiring_digital.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/wiring_digital.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/wiring_pulse.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/wiring_pulse.c
|
||||
avr-gcc -o .pioenvs/arduino_uno/FrameworkArduino/wiring_shift.o -c -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/wiring_shift.c
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/CDC.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/CDC.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HID.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HID.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial0.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial0.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial1.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial1.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial2.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial2.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial3.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial3.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/IPAddress.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/IPAddress.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/Print.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/Print.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/Stream.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/Stream.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/Tone.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/Tone.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/USBCore.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/USBCore.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/WMath.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/WMath.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/WString.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/WString.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/abi.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/abi.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/main.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/main.cpp
|
||||
avr-g++ -o .pioenvs/arduino_uno/FrameworkArduino/new.o -c -fno-exceptions -fno-threadsafe-statics -g -Os -ffunction-sections -fdata-sections -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO_ARCH_AVR -DARDUINO_AVR_UNO -DARDUINO=158 -I.pioenvs/arduino_uno/FrameworkArduino -I.pioenvs/arduino_uno/FrameworkArduinoVariant .pioenvs/arduino_uno/FrameworkArduino/new.cpp
|
||||
avr-ar rcs .pioenvs/arduino_uno/libFrameworkArduino.a .pioenvs/arduino_uno/FrameworkArduino/WInterrupts.o .pioenvs/arduino_uno/FrameworkArduino/hooks.o .pioenvs/arduino_uno/FrameworkArduino/wiring.o .pioenvs/arduino_uno/FrameworkArduino/wiring_analog.o .pioenvs/arduino_uno/FrameworkArduino/wiring_digital.o .pioenvs/arduino_uno/FrameworkArduino/wiring_pulse.o .pioenvs/arduino_uno/FrameworkArduino/wiring_shift.o .pioenvs/arduino_uno/FrameworkArduino/CDC.o .pioenvs/arduino_uno/FrameworkArduino/HID.o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial.o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial0.o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial1.o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial2.o .pioenvs/arduino_uno/FrameworkArduino/HardwareSerial3.o .pioenvs/arduino_uno/FrameworkArduino/IPAddress.o .pioenvs/arduino_uno/FrameworkArduino/Print.o .pioenvs/arduino_uno/FrameworkArduino/Stream.o .pioenvs/arduino_uno/FrameworkArduino/Tone.o .pioenvs/arduino_uno/FrameworkArduino/USBCore.o .pioenvs/arduino_uno/FrameworkArduino/WMath.o .pioenvs/arduino_uno/FrameworkArduino/WString.o .pioenvs/arduino_uno/FrameworkArduino/abi.o .pioenvs/arduino_uno/FrameworkArduino/main.o .pioenvs/arduino_uno/FrameworkArduino/new.o
|
||||
avr-ranlib .pioenvs/arduino_uno/libFrameworkArduino.a
|
||||
avr-g++ -o .pioenvs/arduino_uno/firmware.elf -Os -mmcu=atmega328p -Wl,--gc-sections -Wl,--start-group .pioenvs/arduino_uno/src/EchoServer.o -L.pioenvs/arduino_uno .pioenvs/arduino_uno/libSPI.a .pioenvs/arduino_uno/libAdafruit_CC3000_Library.a .pioenvs/arduino_uno/libFrameworkArduino.a -lm
|
||||
avr-objcopy -O ihex -R .eeprom .pioenvs/arduino_uno/firmware.elf .pioenvs/arduino_uno/firmware.hex
|
||||
.pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000.cpp: In member function 'size_t Adafruit_CC3000_Client::fastrprint(const __FlashStringHelper*)':
|
||||
.pioenvs/arduino_uno/Adafruit_CC3000_Library/Adafruit_CC3000.cpp:1528:23: warning: '__progmem__' attribute ignored [-Wattributes]
|
||||
const char PROGMEM *p = (const char PROGMEM *)ifsh;
|
||||
^
|
||||
.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/sntp.cpp: In member function 'char sntp::GetNTPServerList(const char**, uint32_t*, int)':
|
||||
.pioenvs/arduino_uno/Adafruit_CC3000_Library/utility/sntp.cpp:360:25: warning: converting to non-pointer type 'uint32_t {aka long unsigned int}' from NULL [-Wconversion-null]
|
||||
uint32_t ntpServer= NULL;
|
Submodule examples/atmelavr-and-arduino/arduino-adafruit-library/lib/Adafruit_CC3000_Library deleted from fe3af3da4d
@ -1,25 +0,0 @@
|
||||
#
|
||||
# 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:arduino_uno]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = uno
|
||||
|
||||
# targets = upload
|
@ -1,185 +0,0 @@
|
||||
|
||||
/***************************************************
|
||||
Adafruit CC3000 Breakout/Shield TCP Echo Server
|
||||
|
||||
This is a simple implementation of the echo
|
||||
protocol, RFC 862 http://tools.ietf.org/html/rfc862 ,
|
||||
for the Arduino platform and Adafruit CC3000 breakout
|
||||
or shield. This sketch will create a TCP server that
|
||||
listens by default on port 7 and echos back any data
|
||||
received. Up to 3 clients can be connected concurrently
|
||||
to the server. This sketch is meant as an example of how
|
||||
to write a simple server with the Arduino and CC3000.
|
||||
|
||||
See the CC3000 tutorial on Adafruit's learning system
|
||||
for more information on setting up and using the
|
||||
CC3000:
|
||||
http://learn.adafruit.com/adafruit-cc3000-wifi
|
||||
|
||||
Requirements:
|
||||
|
||||
This sketch requires the Adafruit CC3000 library. You can
|
||||
download the library from:
|
||||
https://github.com/adafruit/Adafruit_CC3000_Library
|
||||
|
||||
For information on installing libraries in the Arduino IDE
|
||||
see this page:
|
||||
http://arduino.cc/en/Guide/Libraries
|
||||
|
||||
Usage:
|
||||
|
||||
Update the SSID and, if necessary, the CC3000 hardware pin
|
||||
information below, then run the sketch and check the
|
||||
output of the serial port. After connecting to the
|
||||
wireless network successfully the sketch will output
|
||||
the IP address of the server and start listening for
|
||||
connections. Once listening for connections, connect
|
||||
to the server from your computer using a telnet client
|
||||
on port 7.
|
||||
|
||||
For example on Linux or Mac OSX, if your CC3000 has an
|
||||
IP address 192.168.1.100 you would execute in a command
|
||||
window:
|
||||
|
||||
telnet 192.168.1.100 7
|
||||
|
||||
After connecting, notice that as you type input and
|
||||
press enter to send it the CC3000 will echo back exactly
|
||||
what you typed. Press ctrl-] and type quit at the prompt
|
||||
to close the telnet session.
|
||||
|
||||
On Windows you'll need to download a telnet client. PuTTY
|
||||
is a good, free GUI client:
|
||||
http://www.chiark.greenend.org.uk/~sgtatham/putty/
|
||||
|
||||
License:
|
||||
|
||||
This example is copyright (c) 2013 Tony DiCola (tony@tonydicola.com)
|
||||
and is released under an open source MIT license. See details at:
|
||||
http://opensource.org/licenses/MIT
|
||||
|
||||
This code was adapted from Adafruit CC3000 library example
|
||||
code which has the following license:
|
||||
|
||||
Designed specifically to work with the Adafruit WiFi products:
|
||||
----> https://www.adafruit.com/products/1469
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried & Kevin Townsend for Adafruit Industries.
|
||||
BSD license, all text above must be included in any redistribution
|
||||
****************************************************/
|
||||
#include <Adafruit_CC3000.h>
|
||||
#include <SPI.h>
|
||||
#include "utility/debug.h"
|
||||
#include "utility/socket.h"
|
||||
|
||||
// These are the interrupt and control pins
|
||||
#define ADAFRUIT_CC3000_IRQ 3 // MUST be an interrupt pin!
|
||||
// These can be any two pins
|
||||
#define ADAFRUIT_CC3000_VBAT 5
|
||||
#define ADAFRUIT_CC3000_CS 10
|
||||
// Use hardware SPI for the remaining pins
|
||||
// On an UNO, SCK = 13, MISO = 12, and MOSI = 11
|
||||
Adafruit_CC3000 cc3000 = Adafruit_CC3000(ADAFRUIT_CC3000_CS, ADAFRUIT_CC3000_IRQ, ADAFRUIT_CC3000_VBAT,
|
||||
SPI_CLOCK_DIVIDER); // you can change this clock speed
|
||||
|
||||
#define WLAN_SSID "myNetwork" // cannot be longer than 32 characters!
|
||||
#define WLAN_PASS "myPassword"
|
||||
// Security can be WLAN_SEC_UNSEC, WLAN_SEC_WEP, WLAN_SEC_WPA or WLAN_SEC_WPA2
|
||||
#define WLAN_SECURITY WLAN_SEC_WPA2
|
||||
|
||||
#define LISTEN_PORT 7 // What TCP port to listen on for connections. The echo protocol uses port 7.
|
||||
|
||||
Adafruit_CC3000_Server echoServer(LISTEN_PORT);
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
Serial.begin(115200);
|
||||
Serial.println(F("Hello, CC3000!\n"));
|
||||
|
||||
Serial.print("Free RAM: "); Serial.println(getFreeRam(), DEC);
|
||||
|
||||
/* Initialise the module */
|
||||
Serial.println(F("\nInitializing..."));
|
||||
if (!cc3000.begin())
|
||||
{
|
||||
Serial.println(F("Couldn't begin()! Check your wiring?"));
|
||||
while(1);
|
||||
}
|
||||
|
||||
Serial.print(F("\nAttempting to connect to ")); Serial.println(WLAN_SSID);
|
||||
if (!cc3000.connectToAP(WLAN_SSID, WLAN_PASS, WLAN_SECURITY)) {
|
||||
Serial.println(F("Failed!"));
|
||||
while(1);
|
||||
}
|
||||
|
||||
Serial.println(F("Connected!"));
|
||||
|
||||
Serial.println(F("Request DHCP"));
|
||||
while (!cc3000.checkDHCP())
|
||||
{
|
||||
delay(100); // ToDo: Insert a DHCP timeout!
|
||||
}
|
||||
|
||||
/* Display the IP address DNS, Gateway, etc. */
|
||||
while (! displayConnectionDetails()) {
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
/*********************************************************/
|
||||
/* You can safely remove this to save some flash memory! */
|
||||
/*********************************************************/
|
||||
Serial.println(F("\r\nNOTE: This sketch may cause problems with other sketches"));
|
||||
Serial.println(F("since the .disconnect() function is never called, so the"));
|
||||
Serial.println(F("AP may refuse connection requests from the CC3000 until a"));
|
||||
Serial.println(F("timeout period passes. This is normal behaviour since"));
|
||||
Serial.println(F("there isn't an obvious moment to disconnect with a server.\r\n"));
|
||||
|
||||
// Start listening for connections
|
||||
echoServer.begin();
|
||||
|
||||
Serial.println(F("Listening for connections..."));
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
// Try to get a client which is connected.
|
||||
Adafruit_CC3000_ClientRef client = echoServer.available();
|
||||
if (client) {
|
||||
// Check if there is data available to read.
|
||||
if (client.available() > 0) {
|
||||
// Read a byte and write it to all clients.
|
||||
uint8_t ch = client.read();
|
||||
client.write(ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**************************************************************************/
|
||||
/*!
|
||||
@brief Tries to read the IP address and other connection details
|
||||
*/
|
||||
/**************************************************************************/
|
||||
bool displayConnectionDetails(void)
|
||||
{
|
||||
uint32_t ipAddress, netmask, gateway, dhcpserv, dnsserv;
|
||||
|
||||
if(!cc3000.getIPAddress(&ipAddress, &netmask, &gateway, &dhcpserv, &dnsserv))
|
||||
{
|
||||
Serial.println(F("Unable to retrieve the IP Address!\r\n"));
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
Serial.print(F("\nIP Addr: ")); cc3000.printIPdotsRev(ipAddress);
|
||||
Serial.print(F("\nNetmask: ")); cc3000.printIPdotsRev(netmask);
|
||||
Serial.print(F("\nGateway: ")); cc3000.printIPdotsRev(gateway);
|
||||
Serial.print(F("\nDHCPsrv: ")); cc3000.printIPdotsRev(dhcpserv);
|
||||
Serial.print(F("\nDNSserv: ")); cc3000.printIPdotsRev(dnsserv);
|
||||
Serial.println();
|
||||
return true;
|
||||
}
|
||||
}
|
@ -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/arduino-external-libs
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
1
examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library
Submodule
1
examples/atmelavr-and-arduino/arduino-external-libs/lib/Adafruit-PCD8544-Nokia-5110-LCD-library
Submodule
@ -0,0 +1,63 @@
|
||||
#
|
||||
# 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:arduino_uno]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = uno
|
||||
|
||||
[env:arduino_ethernet]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = ethernet
|
||||
|
||||
[env:arduino_leonardo]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = leonardo
|
||||
|
||||
[env:arduino_pro16MHzatmega168]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = pro16MHzatmega168
|
||||
|
||||
[env:arduino_megaatmega1280]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = megaatmega1280
|
||||
|
||||
[env:arduino_micro]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = micro
|
||||
|
||||
[env:arduino_robotControl]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = robotControl
|
||||
|
||||
[env:arduino_yun]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = yun
|
||||
|
||||
#[env:arduino_due]
|
||||
#platform = atmelsam
|
||||
#framework = arduino
|
||||
#board = due
|
@ -0,0 +1,350 @@
|
||||
/*********************************************************************
|
||||
This is an example sketch for our Monochrome Nokia 5110 LCD Displays
|
||||
|
||||
Pick one up today in the adafruit shop!
|
||||
------> http://www.adafruit.com/products/338
|
||||
|
||||
These displays use SPI to communicate, 4 or 5 pins are required to
|
||||
interface
|
||||
|
||||
Adafruit invests time and resources providing this open source code,
|
||||
please support Adafruit and open-source hardware by purchasing
|
||||
products from Adafruit!
|
||||
|
||||
Written by Limor Fried/Ladyada for Adafruit Industries.
|
||||
BSD license, check license.txt for more information
|
||||
All text above, and the splash screen must be included in any redistribution
|
||||
*********************************************************************/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Adafruit_GFX.h>
|
||||
#include <Adafruit_PCD8544.h>
|
||||
|
||||
// Software SPI (slower updates, more flexible pin options):
|
||||
// pin 7 - Serial clock out (SCLK)
|
||||
// pin 6 - Serial data out (DIN)
|
||||
// pin 5 - Data/Command select (D/C)
|
||||
// pin 4 - LCD chip select (CS)
|
||||
// pin 3 - LCD reset (RST)
|
||||
Adafruit_PCD8544 display = Adafruit_PCD8544(7, 6, 5, 4, 3);
|
||||
|
||||
// Hardware SPI (faster, but must use certain hardware pins):
|
||||
// SCK is LCD serial clock (SCLK) - this is pin 13 on Arduino Uno
|
||||
// MOSI is LCD DIN - this is pin 11 on an Arduino Uno
|
||||
// pin 5 - Data/Command select (D/C)
|
||||
// pin 4 - LCD chip select (CS)
|
||||
// pin 3 - LCD reset (RST)
|
||||
// Adafruit_PCD8544 display = Adafruit_PCD8544(5, 4, 3);
|
||||
// Note with hardware SPI MISO and SS pins aren't used but will still be read
|
||||
// and written to during SPI transfer. Be careful sharing these pins!
|
||||
|
||||
#define NUMFLAKES 10
|
||||
#define XPOS 0
|
||||
#define YPOS 1
|
||||
#define DELTAY 2
|
||||
|
||||
|
||||
#define LOGO16_GLCD_HEIGHT 16
|
||||
#define LOGO16_GLCD_WIDTH 16
|
||||
|
||||
static const unsigned char PROGMEM logo16_glcd_bmp[] =
|
||||
{ B00000000, B11000000,
|
||||
B00000001, B11000000,
|
||||
B00000001, B11000000,
|
||||
B00000011, B11100000,
|
||||
B11110011, B11100000,
|
||||
B11111110, B11111000,
|
||||
B01111110, B11111111,
|
||||
B00110011, B10011111,
|
||||
B00011111, B11111100,
|
||||
B00001101, B01110000,
|
||||
B00011011, B10100000,
|
||||
B00111111, B11100000,
|
||||
B00111111, B11110000,
|
||||
B01111100, B11110000,
|
||||
B01110000, B01110000,
|
||||
B00000000, B00110000 };
|
||||
|
||||
void setup() {
|
||||
Serial.begin(9600);
|
||||
|
||||
display.begin();
|
||||
// init done
|
||||
|
||||
// you can change the contrast around to adapt the display
|
||||
// for the best viewing!
|
||||
display.setContrast(50);
|
||||
|
||||
display.display(); // show splashscreen
|
||||
delay(2000);
|
||||
display.clearDisplay(); // clears the screen and buffer
|
||||
|
||||
// draw a single pixel
|
||||
display.drawPixel(10, 10, BLACK);
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw many lines
|
||||
testdrawline();
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw rectangles
|
||||
testdrawrect();
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw multiple rectangles
|
||||
testfillrect();
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw mulitple circles
|
||||
testdrawcircle();
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw a circle, 10 pixel radius
|
||||
display.fillCircle(display.width()/2, display.height()/2, 10, BLACK);
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
testdrawroundrect();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
testfillroundrect();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
testdrawtriangle();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
testfilltriangle();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// draw the first ~12 characters in the font
|
||||
testdrawchar();
|
||||
display.display();
|
||||
delay(2000);
|
||||
display.clearDisplay();
|
||||
|
||||
// text display tests
|
||||
display.setTextSize(1);
|
||||
display.setTextColor(BLACK);
|
||||
display.setCursor(0,0);
|
||||
display.println("Hello, world!");
|
||||
display.setTextColor(WHITE, BLACK); // 'inverted' text
|
||||
display.println(3.141592);
|
||||
display.setTextSize(2);
|
||||
display.setTextColor(BLACK);
|
||||
display.print("0x"); display.println(0xDEADBEEF, HEX);
|
||||
display.display();
|
||||
delay(2000);
|
||||
|
||||
// rotation example
|
||||
display.clearDisplay();
|
||||
display.setRotation(1); // rotate 90 degrees counter clockwise, can also use values of 2 and 3 to go further.
|
||||
display.setTextSize(1);
|
||||
display.setTextColor(BLACK);
|
||||
display.setCursor(0,0);
|
||||
display.println("Rotation");
|
||||
display.setTextSize(2);
|
||||
display.println("Example!");
|
||||
display.display();
|
||||
delay(2000);
|
||||
|
||||
// revert back to no rotation
|
||||
display.setRotation(0);
|
||||
|
||||
// miniature bitmap display
|
||||
display.clearDisplay();
|
||||
display.drawBitmap(30, 16, logo16_glcd_bmp, 16, 16, 1);
|
||||
display.display();
|
||||
|
||||
// invert the display
|
||||
display.invertDisplay(true);
|
||||
delay(1000);
|
||||
display.invertDisplay(false);
|
||||
delay(1000);
|
||||
|
||||
// draw a bitmap icon and 'animate' movement
|
||||
testdrawbitmap(logo16_glcd_bmp, LOGO16_GLCD_WIDTH, LOGO16_GLCD_HEIGHT);
|
||||
}
|
||||
|
||||
|
||||
void loop() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
void testdrawbitmap(const uint8_t *bitmap, uint8_t w, uint8_t h) {
|
||||
uint8_t icons[NUMFLAKES][3];
|
||||
srandom(666); // whatever seed
|
||||
|
||||
// initialize
|
||||
for (uint8_t f=0; f< NUMFLAKES; f++) {
|
||||
icons[f][XPOS] = random() % display.width();
|
||||
icons[f][YPOS] = 0;
|
||||
icons[f][DELTAY] = random() % 5 + 1;
|
||||
|
||||
Serial.print("x: ");
|
||||
Serial.print(icons[f][XPOS], DEC);
|
||||
Serial.print(" y: ");
|
||||
Serial.print(icons[f][YPOS], DEC);
|
||||
Serial.print(" dy: ");
|
||||
Serial.println(icons[f][DELTAY], DEC);
|
||||
}
|
||||
|
||||
while (1) {
|
||||
// draw each icon
|
||||
for (uint8_t f=0; f< NUMFLAKES; f++) {
|
||||
display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, BLACK);
|
||||
}
|
||||
display.display();
|
||||
delay(200);
|
||||
|
||||
// then erase it + move it
|
||||
for (uint8_t f=0; f< NUMFLAKES; f++) {
|
||||
display.drawBitmap(icons[f][XPOS], icons[f][YPOS], logo16_glcd_bmp, w, h, WHITE);
|
||||
// move it
|
||||
icons[f][YPOS] += icons[f][DELTAY];
|
||||
// if its gone, reinit
|
||||
if (icons[f][YPOS] > display.height()) {
|
||||
icons[f][XPOS] = random() % display.width();
|
||||
icons[f][YPOS] = 0;
|
||||
icons[f][DELTAY] = random() % 5 + 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void testdrawchar(void) {
|
||||
display.setTextSize(1);
|
||||
display.setTextColor(BLACK);
|
||||
display.setCursor(0,0);
|
||||
|
||||
for (uint8_t i=0; i < 168; i++) {
|
||||
if (i == '\n') continue;
|
||||
display.write(i);
|
||||
//if ((i > 0) && (i % 14 == 0))
|
||||
//display.println();
|
||||
}
|
||||
display.display();
|
||||
}
|
||||
|
||||
void testdrawcircle(void) {
|
||||
for (int16_t i=0; i<display.height(); i+=2) {
|
||||
display.drawCircle(display.width()/2, display.height()/2, i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testfillrect(void) {
|
||||
uint8_t color = 1;
|
||||
for (int16_t i=0; i<display.height()/2; i+=3) {
|
||||
// alternate colors
|
||||
display.fillRect(i, i, display.width()-i*2, display.height()-i*2, color%2);
|
||||
display.display();
|
||||
color++;
|
||||
}
|
||||
}
|
||||
|
||||
void testdrawtriangle(void) {
|
||||
for (int16_t i=0; i<min(display.width(),display.height())/2; i+=5) {
|
||||
display.drawTriangle(display.width()/2, display.height()/2-i,
|
||||
display.width()/2-i, display.height()/2+i,
|
||||
display.width()/2+i, display.height()/2+i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testfilltriangle(void) {
|
||||
uint8_t color = BLACK;
|
||||
for (int16_t i=min(display.width(),display.height())/2; i>0; i-=5) {
|
||||
display.fillTriangle(display.width()/2, display.height()/2-i,
|
||||
display.width()/2-i, display.height()/2+i,
|
||||
display.width()/2+i, display.height()/2+i, color);
|
||||
if (color == WHITE) color = BLACK;
|
||||
else color = WHITE;
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testdrawroundrect(void) {
|
||||
for (int16_t i=0; i<display.height()/2-2; i+=2) {
|
||||
display.drawRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, BLACK);
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testfillroundrect(void) {
|
||||
uint8_t color = BLACK;
|
||||
for (int16_t i=0; i<display.height()/2-2; i+=2) {
|
||||
display.fillRoundRect(i, i, display.width()-2*i, display.height()-2*i, display.height()/4, color);
|
||||
if (color == WHITE) color = BLACK;
|
||||
else color = WHITE;
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testdrawrect(void) {
|
||||
for (int16_t i=0; i<display.height()/2; i+=2) {
|
||||
display.drawRect(i, i, display.width()-2*i, display.height()-2*i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
}
|
||||
|
||||
void testdrawline() {
|
||||
for (int16_t i=0; i<display.width(); i+=4) {
|
||||
display.drawLine(0, 0, i, display.height()-1, BLACK);
|
||||
display.display();
|
||||
}
|
||||
for (int16_t i=0; i<display.height(); i+=4) {
|
||||
display.drawLine(0, 0, display.width()-1, i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
delay(250);
|
||||
|
||||
display.clearDisplay();
|
||||
for (int16_t i=0; i<display.width(); i+=4) {
|
||||
display.drawLine(0, display.height()-1, i, 0, BLACK);
|
||||
display.display();
|
||||
}
|
||||
for (int8_t i=display.height()-1; i>=0; i-=4) {
|
||||
display.drawLine(0, display.height()-1, display.width()-1, i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
delay(250);
|
||||
|
||||
display.clearDisplay();
|
||||
for (int16_t i=display.width()-1; i>=0; i-=4) {
|
||||
display.drawLine(display.width()-1, display.height()-1, i, 0, BLACK);
|
||||
display.display();
|
||||
}
|
||||
for (int16_t i=display.height()-1; i>=0; i-=4) {
|
||||
display.drawLine(display.width()-1, display.height()-1, 0, i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
delay(250);
|
||||
|
||||
display.clearDisplay();
|
||||
for (int16_t i=0; i<display.height(); i+=4) {
|
||||
display.drawLine(display.width()-1, 0, 0, i, BLACK);
|
||||
display.display();
|
||||
}
|
||||
for (int16_t i=0; i<display.width(); i+=4) {
|
||||
display.drawLine(display.width()-1, 0, i, display.height()-1, BLACK);
|
||||
display.display();
|
||||
}
|
||||
delay(250);
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
Arduino Example: Build code with internal library
|
||||
=================================================
|
||||
|
||||
1. Download ``platformio``
|
||||
`sources <https://github.com/ivankravets/platformio/archive/develop.zip>`_
|
||||
2. Extract ZIP archive
|
||||
3. Then run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
$ cd platformio-develop/examples/arduino-internal-library/
|
||||
|
||||
# Install Atmel AVR development platform with Arduino Framework
|
||||
$ platformio install atmelavr
|
||||
|
||||
# Process example project
|
||||
$ platformio run
|
||||
|
||||
.. image:: console-result.png
|
@ -1,25 +0,0 @@
|
||||
#
|
||||
# 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:arduino_pro5v]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = pro16MHzatmega168
|
||||
|
||||
# targets = upload
|
@ -1,51 +0,0 @@
|
||||
/**
|
||||
* Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
* See LICENSE for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* EEPROM Read
|
||||
*
|
||||
* Reads the value of each byte of the EEPROM and prints it
|
||||
* to the computer.
|
||||
* This example code is in the public domain.
|
||||
*
|
||||
* https://github.com/arduino/Arduino/blob/master/libraries/EEPROM/examples/eeprom_read/eeprom_read.ino
|
||||
*/
|
||||
|
||||
#include <Arduino.h>
|
||||
#include <EEPROM.h>
|
||||
|
||||
// start reading from the first byte (address 0) of the EEPROM
|
||||
int address = 0;
|
||||
byte value;
|
||||
|
||||
void setup()
|
||||
{
|
||||
// initialize serial and wait for port to open:
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
; // wait for serial port to connect. Needed for Leonardo only
|
||||
}
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// read a byte from the current address of the EEPROM
|
||||
value = EEPROM.read(address);
|
||||
|
||||
Serial.print(address);
|
||||
Serial.print("\t");
|
||||
Serial.print(value, DEC);
|
||||
Serial.println();
|
||||
|
||||
// advance to the next address of the EEPROM
|
||||
address = address + 1;
|
||||
|
||||
// there are only 512 bytes of EEPROM, from 0 to 511, so if we're
|
||||
// on address 512, wrap around to address 0
|
||||
if (address == 512)
|
||||
address = 0;
|
||||
|
||||
delay(500);
|
||||
}
|
@ -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/arduino-internal-libs
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
@ -0,0 +1,63 @@
|
||||
#
|
||||
# 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:arduino_uno]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = uno
|
||||
|
||||
[env:arduino_ethernet]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = ethernet
|
||||
|
||||
[env:arduino_leonardo]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = leonardo
|
||||
|
||||
[env:arduino_pro16MHzatmega168]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = pro16MHzatmega168
|
||||
|
||||
[env:arduino_megaatmega1280]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = megaatmega1280
|
||||
|
||||
[env:arduino_micro]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = micro
|
||||
|
||||
[env:arduino_robotControl]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = robotControl
|
||||
|
||||
[env:arduino_yun]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = yun
|
||||
|
||||
#[env:arduino_due]
|
||||
#platform = atmelsam
|
||||
#framework = arduino
|
||||
#board = due
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
Chat Server
|
||||
|
||||
A simple server that distributes any incoming messages to all
|
||||
connected clients. To use telnet to your device's IP address and type.
|
||||
You can see the client's input in the serial monitor as well.
|
||||
Using an Arduino Wiznet Ethernet shield.
|
||||
|
||||
Circuit:
|
||||
* Ethernet shield attached to pins 10, 11, 12, 13
|
||||
* Analog inputs attached to pins A0 through A5 (optional)
|
||||
|
||||
created 18 Dec 2009
|
||||
by David A. Mellis
|
||||
modified 9 Apr 2012
|
||||
by Tom Igoe
|
||||
|
||||
*/
|
||||
|
||||
#include <SPI.h>
|
||||
#include <Ethernet.h>
|
||||
|
||||
// Enter a MAC address and IP address for your controller below.
|
||||
// The IP address will be dependent on your local network.
|
||||
// gateway and subnet are optional:
|
||||
byte mac[] = {
|
||||
0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED
|
||||
};
|
||||
IPAddress ip(192, 168, 1, 177);
|
||||
IPAddress gateway(192, 168, 1, 1);
|
||||
IPAddress subnet(255, 255, 0, 0);
|
||||
|
||||
|
||||
// telnet defaults to port 23
|
||||
EthernetServer server(23);
|
||||
boolean alreadyConnected = false; // whether or not the client was connected previously
|
||||
|
||||
void setup() {
|
||||
// initialize the ethernet device
|
||||
Ethernet.begin(mac, ip, gateway, subnet);
|
||||
// start listening for clients
|
||||
server.begin();
|
||||
// Open serial communications and wait for port to open:
|
||||
Serial.begin(9600);
|
||||
while (!Serial) {
|
||||
; // wait for serial port to connect. Needed for Leonardo only
|
||||
}
|
||||
|
||||
|
||||
Serial.print("Chat server address:");
|
||||
Serial.println(Ethernet.localIP());
|
||||
}
|
||||
|
||||
void loop() {
|
||||
// wait for a new client:
|
||||
EthernetClient client = server.available();
|
||||
|
||||
// when the client sends the first byte, say hello:
|
||||
if (client) {
|
||||
if (!alreadyConnected) {
|
||||
// clead out the input buffer:
|
||||
client.flush();
|
||||
Serial.println("We have a new client");
|
||||
client.println("Hello, client!");
|
||||
alreadyConnected = true;
|
||||
}
|
||||
|
||||
if (client.available() > 0) {
|
||||
// read the bytes incoming from the client:
|
||||
char thisChar = client.read();
|
||||
// echo the bytes back to the client:
|
||||
server.write(thisChar);
|
||||
// echo the bytes to the server as well:
|
||||
Serial.write(thisChar);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -1,20 +1,21 @@
|
||||
Atmel AVR: Native Blink Example
|
||||
===============================
|
||||
How to buid PlatformIO based project
|
||||
====================================
|
||||
|
||||
1. Download ``platformio``
|
||||
`sources <https://github.com/ivankravets/platformio/archive/develop.zip>`_
|
||||
2. Extract ZIP archive
|
||||
3. Then run these commands:
|
||||
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-native-blink/
|
||||
|
||||
# Install Atmel AVR development platform
|
||||
$ platformio install atmelavr
|
||||
> cd platformio-develop/examples/atmelavr-and-arduino/atmelavr-native-blink
|
||||
|
||||
# Process example project
|
||||
$ platformio run
|
||||
> platformio run
|
||||
|
||||
.. image:: console-result.png
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 126 KiB |
@ -56,7 +56,7 @@ env.Replace(
|
||||
"-Os",
|
||||
"-mmcu=$BOARD_MCU",
|
||||
"-Wl,--gc-sections",
|
||||
"-Wl,--start-group"
|
||||
# "-Wl,--start-group"
|
||||
],
|
||||
|
||||
SIZEPRINTCMD='"$SIZETOOL" --mcu=$BOARD_MCU -C -d $SOURCES',
|
||||
|
Reference in New Issue
Block a user