getting started with flora - descargas.cetronic.esdescargas.cetronic.es/tutorialflora.pdfoverview...

29
Getting Started with FLORA Created by Becky Stern Last updated on 2015-02-20 01:19:14 PM EST

Upload: others

Post on 08-Aug-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Getting Started with FLORACreated by Becky Stern

Last updated on 2015-02-20 01:19:14 PM EST

Page 2: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

2366

7789

1418192021

2223242626

28

Guide Contents

Guide ContentsOverviewDownload software

Mac OSX

Install Drivers! (Windows Only)Windows 8Windows 7Locating the Driver File (Win 7 & XP)

Blink onboard LEDPower your FLORAThe VBATT PadFLORA pinout diagram

Some Technical Specs:

FLORA projectsFLORA techniquesFLORA modulesIDE Florafication

For Arduino IDE v1.0

On Arduino IDE 1.6

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 2 of 29

Page 3: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Overview

FLORA is Adafruit's wearable electronics platform. We designed it from the ground up to provide thebest experience for Adafruit's community of makers, hackers, crafters, artists, designers andengineers. It's built around the Atmega32u4 chip, which has built-in USB support. No pesky specialcables or extra parts for programming, just plug it in and get started making the wearables project ofyour dreams! Works on Windows and Mac.

The FLORA is extremely beginner-friendly-- it is difficult to destroy the FLORA by connecting abattery backwards due to polarized connector and protection diodes. The onboard regulator meansthat even connecting a 9V battery will not result in damage or tears.

This guide is the first step in using FLORA, plugging it in and programming it to blink its onboardLED! After that you can move on to our Flora RGB Smart Pixels tutorial (http://adafru.it/aRT) and/orFlora GPS tutorial (http://adafru.it/aRP).

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 3 of 29

Page 4: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Adafruit created the FLORA from scratch after many months of research and we really think wecame up with something that will empower some amazing wearable projects.

The FLORA is small (1.75" diameter). We wanted the smallest possible board for our wearableplatform. It's based on our experiences shipping our own, shipping, customer-testedAtmega32u4 (http://adafru.it/296) Breakout Board (http://adafru.it/296).

FLORA has a small but easy to use onboard reset button to reboot the system. The power supply isdeigned to be flexible and easy to use. There is an onboard polarized 2 JST battery connector withprotection schottky diode for use with external battery packs from 3.5v to 9v DC in (It can run on 3Vbut 3.5V-5V or higher is ideal). Can be used with LiIon/LiPoly, LiFe, alkaline or rechargeableNiMh/NiCad batteries of any size. The FLORA does not have a LiPo charger included by design, this allows safe use with multiplebattery types and reduces risk of fire as it is not recommended to charge these batteries on fabric.

FLORA has built-in USB support. Built in USB means you plug it in to program it, it just shows up. Noadditional purchases are needed! Works with Mac, Windows, Linux, any USB cable works great.Currently the PCB comes with a mini B connector but future versions may change to microUSB. The FLORA has USB HID support, so it can act like a mouse or keyboard, etc.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 4 of 29

Page 5: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 5 of 29

Page 6: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Download softwareTo start, please download our version of the Arduino IDE that's been updated to include the Floradrivers, libraries & code examples! We have versions for Windows and Mac OS X.

For Mac, click the button below - then unzip. Move the application to your Applications folder.

Windows Arduino IDE v1.05 w/Trinket,Gemma, Flora

http://adafru.it/cUa

Mac Arduino IDE v1.05 w/Trinket,Gemma, Flora

http://adafru.it/cTN

Linux (32-bit) Arduino IDE 1.0.5 w/Trinket, Gemma, Flora

http://adafru.it/dXa

Linux (64-bit) Arduino IDE 1.0.5 w/Trinket, Gemma, Flora

http://adafru.it/dXb

Mac OSX

If you're using Mac OS Mavericks you will need to update the setting to permit running Arduino IDE

1. Go to your Security and Privacy Settings2. Click the Lock Icon and Login3. Change "Allow Apps Downloaded From": to "Anywhere"4. Launch the app, then go back to Security Settings and change the selection back to "Mac App

Store and Identified developers"5. You only need to do this procedure once - the Mac will remember that it's OK to run the

Arduino App.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 6 of 29

Page 7: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Install Drivers! (Windows Only)

Mac users, you can skip to the next part of the tutorial - you don't need to install any drivers!

For Windows users, you'll need to install the drivers for the Flora. Begin by plugging in the Floraboard. Look for a green power LED (left of the mini USB jack) and a pulsing red LED (right of themini USB jack).

WinXP users, skip down past these few photos, you should get a popup asking you for a driverlocation, just browse to it as shown.

Windows 8We now have signed Windows 8 drivers for flora. Download the driver by clicking here. You shouldbe able to right-click the inf file to install it directly, or point Windows to this uncompressed folderwhen prompted!

Download the Windows 8 signed Flora

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 7 of 29

Page 8: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Driver

http://adafru.it/dpT

Windows 7You'll see this pop up in the bottom right corner:

Now go to the Start menu (bottom left corner, the round windows logo) and click on it and starttyping in Device Manager

Click on the Device Manager (top icon in the menu) to launch it, scroll down until you see Adafruit

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 8 of 29

Page 9: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Flora with a ! mark. Right click and select Update Driver Software

Locating the Driver File (Win 7 & XP)OK if you have XP you'll basically start from here, click Browse my computer for driver software

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 9 of 29

Page 10: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Then browse to the uncompressed Flora IDE folder, and select the drivers folder (not any otherfolder!) and click OK.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 10 of 29

Page 11: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 11 of 29

Page 12: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Make sure the folder next to the Browse... button is correct, then click Next.

When you get this scary window next, click Install this driver software anyway.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 12 of 29

Page 13: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

That's it! Thankfully you only have to do this once.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 13 of 29

Page 14: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Blink onboard LED

Next it's time to load up a program on your FLORA. There is an LED on board, so let's blink it! Plugin the USB cable and paste the following code into the Adafruit Flora IDE:

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 14 of 29

Page 15: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

From the Tools menu, under "Board," choose "Adafruit Flora"

// Pin D7 has an LED connected on FLORA.// give it a name:int led = 7;

// 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); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(led, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second}

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 15 of 29

Page 16: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Also in the Tools menu, under "Serial Port," choose the one that contains the phrase "usbmodem" ifyou have a Mac. If you're using a Windows computer, it will be named COMsomething, but not COM1 or COM2 (so itwill be whatever comes after those two if they exist, such as COM3 or COM4).

Press the Upload button to transmit the program to the FLORA. It looks like an arrow pointing to theright.

That's it! The on board LED marked "D7" should blink on and off repeatedly, and you'vesuccessfully programmed your FLORA!

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 16 of 29

Page 17: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 17 of 29

Page 18: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Power your FLORAThe Flora runs at 3.3V with an onboard regulator to keep the voltage steady. You'll need to powerthe board with a 3.6V or greater battery. For that reason, we find 3 x AA or AAA or a lithium-polymerbattery to be ideal. You can only power FLORA through its onboard JST port.

After loading your program onto the FLORA, you'll want to unplug the USB cable and go portablewith battery power! USB will always power the board, but battery power (through the JST connector)can be turned on and off with Flora's onboard switch (near the "ON" text on the board). Werecommend our 3xAAA holder (http://adafru.it/727) for beginners, which conveniently plugs intoFLORAs JST port.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 18 of 29

Page 19: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

More advanced users may wish to use a rechargeable lithium polymer battery (http://adafru.it/258)for their smaller size and longer duration. These batteries pose added risk if abused, shorted, bent,crushed, or punctured. FLORA does not have onboard charging, so you would also need aseparate LiPoly charger (http://adafru.it/259).

The VBATT Pad

The most commonly confused part of the Flora is the VBATT pad and how power management ishandled in the Flora. We designed the flora to be mainly powered via the JST connector. You canpower it with a battery pack or lipo battery. That input is polarity protected and also controlled viathe on/off switch. The battery output after the switch is VBATT. You shouldn't use VBATT as aninput as you might damage your battery if you also plug in the USB connector to a computer! Theideal use of VBATT is when you want to power something like NeoPixels or a servo, something thatrequires more than the 150mA available from the onboard regulator.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 19 of 29

Page 20: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

FLORA pinout diagram

For handy reference, we've created this pinout diagram illustrating all the alternate functions foreach of the pins on the Flora.

The most commonly confused part of the Flora is the VBATT pad and how power management ishandled in the Flora. We designed the flora to be mainly powered via the JST connector. You canpower it with a battery pack or lipo battery. That input is polarity protected and also controlled viathe on/off switch. The battery output after the switch is VBATT. You shouldn't use VBATT as aninput as you might damage your battery if you also plug in the USB connector to a computer! Theideal use of VBATT is when you want to power something like NeoPixels or a servo, something thatrequires more than the 150mA available from the onboard regulator.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 20 of 29

Page 21: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Some Technical Specs:

Battery input (JST): 3.5-16V (the regulator is MIC5225-3.3 (http://adafru.it/dQO)) withreverse polarity protection, 2A max rated connector. We recommend no more than 6VDC sothat the 3.3V regulator does not overheatUSB input: 4.5V-5.5V with 500mA fuse3.3V output pad: we recommend no more than 100mA, as the regulator can supply 150mAand the Flora Mainboard uses 20mA. but you can probably draw up to 250mA in spikesClock speed: 8MHzChipset: ATmega32u4VBAT output pad: the higher of the VBAT JST input voltage and USB voltage (two schottkeydiode connection)Current Draw: 8mA quiescent, another 2mA when the pin #D7 LED is on.

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 21 of 29

Page 22: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

FLORA projectsFlora Pixel Brooch (http://adafru.it/aTj)

Flora TV-B-Gone (http://adafru.it/aUk)

GPS Jacket (http://adafru.it/aWF)

Capacitive Touch with Conductive Fabric (http://adafru.it/aWG)

Wearable Piezo Tones (http://adafru.it/aWH)

LED Ampli-Tie (http://adafru.it/c1u)

Plush Game Controller (http://adafru.it/c9F)

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 22 of 29

Page 23: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

FLORA techniquesFlora snaps (http://adafru.it/aUl)

Conductive thread (http://adafru.it/aVx)

Capacitive Touch with Conductive Fabric & Flora (http://adafru.it/aWG)

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 23 of 29

Page 24: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

FLORA modulesFLORA Accelerometer + Compass (http://adafru.it/aYS)

FLORA Luminosity Sensor (http://adafru.it/c9H)

FLORA GPS (http://adafru.it/aRP)

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 24 of 29

Page 25: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

Flora RGB Smart NeoPixels (http://adafru.it/c9J)

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 25 of 29

Page 26: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

IDE FloraficationFor Arduino IDE v1.0

If you have a version of the Arduino IDE that you want to 'Floraify' - it isn't that hard! Try thefollowing instructions to add support to your IDE, works with anything after v1.0 (and its known goodwith v1.0.5)

Find your boards.txt file its in the Arduino/hardware/arduino folder on Windows for version 1.0 IDE

On a Mac right click the application and select "Show Package Contents," then navigate toContents/Resources/Java/hardware/Arduino) and add to the bottom:

Place in arduino-1.0.5\drivers (Windows only):

Adafruit_Flora.inf

http://adafru.it/cFH

Add to hardware/arduino/variants/flora (windows) or hardware/arduino/avr/variants/flora(mac) (create folder):

flora8.name=Adafruit Floraflora8.upload.protocol=avr109flora8.upload.maximum_size=28672flora8.upload.speed=57600flora8.upload.disable_flushing=trueflora8.bootloader.low_fuses=0xffflora8.bootloader.high_fuses=0xd8flora8.bootloader.extended_fuses=0xcbflora8.bootloader.path=caterinaflora8.bootloader.file=Caterina-Flora8.hexflora8.bootloader.unlock_bits=0x3Fflora8.bootloader.lock_bits=0x2Fflora8.build.mcu=atmega32u4flora8.build.f_cpu=8000000Lflora8.build.vid=0x239Aflora8.build.pid=0x8004flora8.build.core=arduinoflora8.build.variant=flora

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 26 of 29

Page 27: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

pins_arduino.h

http://adafru.it/cFI

Add to hardware/arduino/bootloaders/caterina (windows) orhardware/arduino/avr/bootloaders/caterina (mac)

Caterina-Flora8.hex

http://adafru.it/cFJ

Edit hardware/arduino/cores/arduino/USBCore.cpp (windows) orhardware/arduino/avr/cores/arduino/USBCore.cpp (mac)find:

Add right below it

Then find

or (applies to v1.5):

Add right below it

or (v1.5):

#elif USB_PID == 0x9208 'L','i','l','y','P','a','d','U','S','B',' ',' ',' ',' ',' ',' '

#elif USB_PID == 0x8004 'A','d','a','f','r','u','i','t',' ','F','l','o','r','a',' ',' '

#elif USB_VID == 0x1b4f 'S','p','a','r','k','F','u','n',' ',' ',' '

#elif USB_VID == 0x1b4f#define USB_MANUFACTURER "SparkFun"

#elif USB_VID == 0x239A 'A','d','a','f','r','u','i','t',' ',' ',' '

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 27 of 29

Page 28: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

On Arduino IDE 1.6

If you have a version of the Arduino IDE that you want to 'Floraify' - it isn't that hard! Try thefollowing instructions to add support to your IDE, works with anything after v1.6

Find your boards.txt file its in the Arduino/hardware/arduino/avr folder on Windows for version 1.6IDE

On a Mac right click the application and select "Show Package Contents," then navigate toContents/Resources/Java/hardware/Arduino) and add to the bottom

#elif USB_VID == 0x239A#define USB_MANUFACTURER "Adafruit"

IN PROGRESS!

© Adafruit Industries https://learn.adafruit.com/getting-started-with-flora Page 28 of 29

Page 29: Getting Started with FLORA - descargas.cetronic.esdescargas.cetronic.es/TutorialFlora.pdfOverview FLORA is Adafruit's wearable electronics platform. We designed it from the ground

## Adafruit Flora## --------------------------------------------------flora8.name=Adafruit Flora

flora8.vid.0=0x239Aflora8.pid.0=0x8004flora8.vid.1=0x239Aflora8.pid.1=0x0004

flora8.upload.tool=avr109flora8.upload.protocol=arduinoflora8.upload.maximum_size=28672flora8.upload.maximum_data_size=2048flora8.upload.speed=115200

flora8.bootloader.tool=avrdudeflora8.bootloader.low_fuses=0xFFflora8.bootloader.high_fuses=0xD8flora8.bootloader.extended_fuses=0xCBflora8.bootloader.unlock_bits=0x3Fflora8.bootloader.lock_bits=0x2Fflora8.bootloader.file=caterina/Caterina-Flora8.hex

flora8.build.mcu=atmega32u4flora8.build.f_cpu=8000000Lflora8.build.board=AVR_FLORAflora8.build.core=arduinoflora8.build.variant=flora

© Adafruit Industries Last Updated: 2015-02-20 01:19:14 PM EST Page 29 of 29