![1576530ad9257021d6a36595699db0e0.png](https://i-blog.csdnimg.cn/blog_migrate/541176af462613711f397f1c2fb1695b.jpeg)
![92c427a932ddb6a30e87cee488a731db.png](https://i-blog.csdnimg.cn/blog_migrate/7dd95d3d83de7cea8aed583d5c9508ce.jpeg)
![8b8d2b76245f876109502dce4848d2c1.png](https://i-blog.csdnimg.cn/blog_migrate/f7e82f513b52a3e1721a3d7ee74565c6.jpeg)
FLORA 是一个兼容Arduino的可穿戴电子平台,它是专门为创客、黑客、艺术家、设计师和工程师设计,可以让们能更好的发挥自己的创意。它使用Atmega32u4作为主控芯片,这个芯片内置USB,不需要特殊的电缆或多余的设备就能进行编程。只要把它插入计算机就能开始创造你的可穿戴电子梦想。它可以工作于windows和Mac。
FLORA对于初学者是非常友好的-板上加了电池反接保护,即使你把电池的正负极接反了也不会导致损坏。板载的线性稳压品让你既使连接9V的电池也能正常工作,不会烧坏。
本向导第一步是使用FLORA插入计算机和编程让板上的LED灯闪烁。接下来可以继续向前去学习我们的多彩LED灯编程。
![75eb91ff9cb14ec67df686ee9c55d8ce.png](https://i-blog.csdnimg.cn/blog_migrate/56a59a701a7232805d68a87dbe1ea4e4.jpeg)
FLORA非常小,直径只有1.75英寸,我们想要打造一个尽可能小的可穿戴电子平台。
FLORA板上有一个非常小但是很容易操作的复位按钮来复位系统。电源供电非常灵活易于使用。板载一个分极性的2PIN电池连接器和肖特基保护二极管,可以连接外部的电池组(直流3.V~9V范围内),它可以工作在3V,但是3.5V~5.5V是最合适的。可以使用锂/锂聚合物,LiFe,碱性或可充电的镍氢/镍铬电池。FLORA板上没有包含电池充电,这是出于安全的考虑,避免在使用不同类型的电池充电时可以引起火灾的分险,因此不推荐这些电池在布料上安装时进行充电。
FLORA内置USB支持,内置USB意味着你只要把它插入计算机就可以进行编程,这点是非常显眼的功能,不需要额外购买其它部件。任何的microUSB数据线都可以很好的工作的Windows,linux,Mac系统上。
![b951bee0ee21726475daebdb326c423f.png](https://i-blog.csdnimg.cn/blog_migrate/83b3551ab7a7dd18cbf8a0a48878d4c3.jpeg)
FLORA支持USB HID类,因此你可以用它来实现一个鼠标或键盘等。
怎样开始使用?
一、WINDOWS驱动安装
在插入开发板之前,你可能需要安装一个驱动程序!
点击下方连接下载驱动程序
https://adafru.it/A0N
adafruit_drivers_2.0.0.0
下载完成后运行安装。
![5784dae6200ba5de1f393dcd27b67b74.png](https://i-blog.csdnimg.cn/blog_migrate/f359a3b626ba019d2cc0b4fc11530e12.jpeg)
![b27fac154a2e7c0fad26c5a2287c6703.png](https://i-blog.csdnimg.cn/blog_migrate/a65f7758995f182b5f3b402e374a728f.jpeg)
手动安装驱动
如果windows由于一些其它原因需要一些驱动文件(inf或cat),你也可以点击下方下载完整的驱动压缩包:
https://learn.adafruit.com/adafruit-arduino-ide-setup/windows-driver-installation
当windows寻找安装位置的时候引导它找到驱动程序所在的位置。
下载软件
要对FOLORA进行编程,需要下载ARDUINO IDE,这是一个ARDUINO的官网上下载,下载地址:http://www.arduino.cc
也可以加入我们的Arduino创客交流群,在共享文件里下载。
添加Adafruit的开发板支持包
粘贴下面的这个链接
https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
到Arduino IDE 附加开发板管理器网址输入框:
![517b4deec1ac80ff31e6c76cadc70766.png](https://i-blog.csdnimg.cn/blog_migrate/8f98e4734e8c76dbfe29e1065cfcbd1c.jpeg)
点击“好”保存新的参数设置,接下来我们在“开发板管理器”里找到开发板并安装它。
![954fc716c6f9c27afe8293fee38f783f.png](https://i-blog.csdnimg.cn/blog_migrate/9dc4319b1bf809a53943d3ddbb3f4363.jpeg)
开始你的第一个应用
板载LED灯闪烁
![b39e518799efc18ecce7954e60aa0533.png](https://i-blog.csdnimg.cn/blog_migrate/41ec9457805a2a15ca674ce0df93fd1b.jpeg)
接下来要装载一个程序到的FLORA板,板上有一个LED灯,让它闪烁起来。使用USB数据线把FLORA连接到计算机,然后拷贝下面的代码到你的Arduino IDE编程窗口:
// 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
}
从“工具”菜单下的“Board”,选择“Adafruit Flora”
![0dd4691e0ea9331d34462cef1ecd4981.png](https://i-blog.csdnimg.cn/blog_migrate/35d161f596151cf9f5252fea0f9c5ad8.jpeg)
![d618b7e4018f695a555a2718d0667f0d.png](https://i-blog.csdnimg.cn/blog_migrate/cb4590b902cc853fd7906733afe4a4cd.jpeg)
点击“上传”按钮,将开始编绎程序,等待程充即将编绎完成的时候,按下板上的"Reset"按钮开始烧写程序到Flora开发板,程序下载成功后,板的的LED开始按1秒的频率闪烁,你的第一个应用就这样成功的完成啦!
Project 2 板载多彩LED闪烁
第一步 安装NeoPixel Library
如果你使用的是Arduino IDE 1.6.1及以上版本,你可以安装库管理器来安装这个库, 搜索和安装 Adafruit_NeoPixel这个库。
![5ea2f0c638624f53d67b524ad0c30146.png](https://i-blog.csdnimg.cn/blog_migrate/828eafab90f62e5bcc1eeebfead2d3a4.jpeg)
安装完成后关闭库管理器。
第二步 下载评估代码
把下面的代码段COPY到你的ARDUINO IDE 中,上传代码。
#include <Adafruit_NeoPixel.h>
#define PIN 8
Adafruit_NeoPixel strip = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
void setup() {
strip.begin();
strip.setBrightness(50);
strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// Some example procedures showing how to display to the pixels:
colorWipe(strip.Color(255, 0, 0), 500); // Red
colorWipe(strip.Color(0, 255, 0), 500); // Green
colorWipe(strip.Color(0, 0, 255), 500); // Blue
rainbowCycle(20);
}
// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
// Slightly different, this makes the rainbow equally distributed throughout
void rainbowCycle(uint8_t wait) {
uint16_t i, j;
for(j=0; j<256*5; j++) { // 5 cycles of all colors on wheel
for(i=0; i< strip.numPixels(); i++) {
strip.setPixelColor(i, Wheel(((i * 256 / strip.numPixels()) + j) & 255));
}
strip.show();
delay(wait);
}
}
// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3);
} else if(WheelPos < 170) {
WheelPos -= 85;
return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3);
} else {
WheelPos -= 170;
return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
}
![f7a2057d695d0ebf80e0bc61c8b8cc4a.png](https://i-blog.csdnimg.cn/blog_migrate/b18c3db249d18b92d143938947a622cb.jpeg)
更多关于Flora的作品将持续推出,敬请期待哦!
![473bc898b9fb4326d6d762af009c3302.png](https://i-blog.csdnimg.cn/blog_migrate/5157012c2f53163d825b9434ddf4078e.jpeg)
![b01fd7dfe766827bbc9709a30405f763.png](https://i-blog.csdnimg.cn/blog_migrate/abe60bf2f30b00af60c60a9d3b3df012.jpeg)
![c82340801cfa9882780e043567687845.png](https://i-blog.csdnimg.cn/blog_migrate/bf9368b1bcc1f925b01b3cddb83978dd.jpeg)