header

 

More links

Adobe Connect | Adobe Conect Custom Pods | AutoHotkey | Android | Arduino | Blog | COMM140Fractals | Grammar Checkers | Knots | a Million Dots |  Processing | RedBubble | Tutorials | Weather | World Time Meeting Planner |

Home > Tutorials > LilyPad & Flora > Flora Programs > Minimum Flash

Minimum Flash

 

hookup

 


 

 


#include "Adafruit_FloraPixel.h"

/*****************************************************************************
Example sketch for driving Adafruit Flora pixels
Connect a single pixel to the Flora
Connect the Data in which is a small inwards poinnting arrow on the pixel to D6 on the Flora
Connect - on the Pixel to GND (Ground) on the Flora
Connect + on the Pixel to 3.3v on the Flora
*****************************************************************************/

Adafruit_FloraPixel strip = Adafruit_FloraPixel(1);

void setup() {
   strip.begin(); // Update the strip, this will turn off the pixel.
   strip.show();
}

void loop() {

   strip.setPixelColor(0,127,0,0); // set pixel 0 to green half brightness
   strip.show();
   
delay(1000);

   strip.setPixelColor(0,255,0,0); // set pixel 0 to green full brightness
   strip.show();
   delay(1000);

   strip.setPixelColor(0,127,0,0); // set pixel 0 to green half brightness
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,50,0); // set pixel 0 to a dull red
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,255,0); // set pixel 0 to red full brightness
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,50,0); // set pixel 0 to a dull red
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,0,50); // set pixel 0 to blue
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,0,255); // set pixel 0 to blue full brightness
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,0,50); // set pixel 0 to blue
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,50,50); // set pixel 0 to dull magenta
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,255,255); // set pixel 0 to magenta full brightness
   strip.show();
   delay(1000);

   strip.setPixelColor(0,0,50,50); // set pixel 0 to dull magenta
   strip.show();
   delay(1000);

   strip.setPixelColor(0,50,50,0); // set pixel 0 to dull yellow
   strip.show();
   delay(1000);

   strip.setPixelColor(0,50,50,50); // set pixel 0 to dull white
   strip.show();
   delay(1000);

}

 


APA citation:
Russell, R. (2016, July 04, 03:42 pm). Mimimum flora program
     Retrieved November 20, 2017, from http://www.rupert.id.au/tutorials/lilypad/minimum.php

Last refreshed: November 20 2017. 08:26.36 am

rupert dot russell at acu dot edu dot au Support Wikipedia

Creative Commons License This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.


748 visits since May 14, 2013