Link to this comparison view

Both sides previous revision Previous revision
Next revision Both sides next revision
fabricademy2017:students:nuria.robles:week_12 [2018/02/15 13:29]
nuriafablab_gmail.com
fabricademy2017:students:nuria.robles:week_12 [2018/02/15 13:32]
nuriafablab_gmail.com
Line 60: Line 60:
  
 **I**  installed the Gemma Board following these steps in the [[https://​learn.adafruit.com/​adafruit-arduino-ide-setup/​overview|Adafruit Arduino IDE setup guide]] to easily install a pre-configured Arduino IDE to program Gemma! **I**  installed the Gemma Board following these steps in the [[https://​learn.adafruit.com/​adafruit-arduino-ide-setup/​overview|Adafruit Arduino IDE setup guide]] to easily install a pre-configured Arduino IDE to program Gemma!
- 
-**[[https://​learn.adafruit.com/​add-boards-arduino-v164|If you are running Arduino IDE 1.6.4 or greater, you can also use this quickstart guide to add in the Gemma plugin]]** 
  
 **Blink!** **Blink!**
  
-After the instalation,​ is very useful to upload the **blink** ​ code to the board and see that your PC is talking to your board+After the instalation,​ is very useful to upload the **blink** ​ code to the board and see that your PC is talking to your board. I followed ​ this [[https://​learn.adafruit.com/​introducing-gemma/​setting-up-with-arduino-ide#​|tutorial]] from Adafruit
  
-<code+And whe it all was done, I uploaded the code for the 3 neopixels
-**/* +
-  Blink +
-  Turns on an LED on for one second, then off for one second, repeatedly.+
  
-  This example code is in the public domain.+#include <​Adafruit_NeoPixel.h> \\ #define NUM_LEDS 5 // Number of NeoPixels
  
-  To upload to your  or Trinket: +#define PIN 1 // DIGITAL pin # where NeoPixels are connected // IMPORTANT: Avoid connecting on a live circuit...
-  ​1) Select the proper board from the Tools->​Board Menu (Arduino Gemma if +
-     teal, Adafruit Gemma if black) +
-  2) Select the uploader from the Tools->​Programmer ("​Arduino Gemma" if teal, +
-     "​USBtinyISP"​ if black Gemma) +
-  3) Plug in the Gemma into USB, make sure you see the green LED lit +
-  4) For windows, make sure you install the right Gemma 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+// if you must, connect GND first.
  
-// the setup routine runs once when you press reset: +Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS,​ PIN); 
-void setup() { + 
-  ​// initialize the digital pin as an output. +void setup() { \\ strip.begin();​ \\ strip.setBrightness(100); ​// 100/255 brightness (about 40%) strip.show(); // Initialize all pixels to '​off'​
-  pinMode(led, OUTPUT);+
  
 } }
  
-// the loop routine runs over and over again forever: +void loop() { \\ for(int j=0; j<256; j++) { 
-void loop() { + 
-    ​digitalWrite(ledHIGH); +for(int i=0; i<​NUM_LEDS;​ i++) { strip.setPixelColor(iWheel((i * 8 + j) & 255)); 
-    delay(1000); + 
-    ​digitalWrite(ledLOW); +  } 
-    delay(1000); + 
-}** +  strip.show();​ 
-</​code>​+ 
 +  ​delay(20); 
 + 
 +} } 
 + 
 +// 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) { 
 + 
 +if(WheelPos < 85) { \\ return strip.Color(WheelPos * 3, 255 - WheelPos * 30); 
 + 
 +} else if(WheelPos < 170) { \\ WheelPos -= 85; \\ return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); 
 + 
 +else { \\ WheelPos -= 170; \\ return strip.Color(0,​ WheelPos ​3, 255 - WheelPos ​3);
  
-**flora_gemmaselect.gif https://​cdn-learn.adafruit.com/​assets/​assets/​000/​010/​921/​large1024/​flora_gemmaselect.gif?​1448055330**+} }
  
 \\ \\