Aj Ty v IT
Zo stránky SensorWiki
![](/sensorwiki/images/thumb/7/76/LogoAjTyvIT.png/150px-LogoAjTyvIT.png)
Svetielkujúci Workshop 7. a 14. 6. 2017
Úvod
Krok za krokom
1. Blink
2. Železničné priecestie
3. K.I.T.T. 2000
Druhá časť
Adafruit Gemma
![](/sensorwiki/images/thumb/5/5a/AdafruitGemma.png/500px-AdafruitGemma.png)
V programovacom prostredí Arduino treba najprv nastaviť typ elektronickej dosky na Adafruit Gemma 8MHz v menu Tools->Board.
![](/sensorwiki/images/9/9c/Flora_gemmaselect.gif)
Potom ešte treba vybrať vhodný programovací protokol -
vyeberiete ho z menu Tools->Programmer->USBtinyISP
![](/sensorwiki/images/0/01/Gemma_flora_selectusbtiny.gif)
Vyskúšame postupne jednoduché programy
/* Blink 1 */
#define RED_LED 1
void setup() {
pinMode(RED_LED, OUTPUT);
}
void loop() {
digitalWrite(RED_LED, HIGH);
delay(200);
digitalWrite(RED_LED, LOW);
delay(200);
}
/* Blink 3 */
#define RED_LED 0
#define GREEN_LED 1
#define BLUE_LED 2
void setup() {
pinMode(RED_LED, OUTPUT);
pinMode(GREEN_LED, OUTPUT);
pinMode(BLUE_LED, OUTPUT);
}
void loop() {
digitalWrite(RED_LED, HIGH);
delay(200);
digitalWrite(RED_LED, LOW);
delay(200);
digitalWrite(GREEN_LED, HIGH);
delay(200);
digitalWrite(GREEN_LED, LOW);
delay(200);
digitalWrite(BLUE_LED, HIGH);
delay(200);
digitalWrite(BLUE_LED, LOW);
delay(200);
}
NeoPixel RGB =
Priklady na neopixel
Technicke informacie
- Adafruit Gemma Windows Driver: https://learn.adafruit.com/introducing-gemma/windows-setup
- Adafruit Board Arduino Manager: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- Neopixel Library: https://github.com/adafruit/Adafruit_NeoPixel