|
|
(39 medziľahlých úprav od rovnakého používateľa nie je zobrazených.) |
Riadok 1: |
Riadok 1: |
| [[Súbor:logoAjTyvIT.png|right|150px]] | | [[Súbor:logoAjTyvIT.png|right|150px]] Z tejto stránky sa dostanete k materiálom k jednotlivým kurzom |
| | * [[Svetielkujúci workshop]] |
| | * [[ColorMix Workshop]] |
| | * [[Micro:bit workshop]] pre učiteľov |
| | * [[Micro:bit workshop pre pokročilých]] učiteľov |
| | * [[OzoBot robot]] workshop |
|
| |
|
| = '''Svetielkujúci Workshop 7. a 14. 6. 2017''' =
| |
|
| |
|
| |
| [[Súbor:wearableDef.png|500px]]
| |
|
| |
|
| |
|
| |
| == Úvod ==
| |
|
| |
|
| |
| * [http://senzor.robotika.sk/balogh/wearable.pdf Úvodná prezentácia]
| |
| ** [https://player.vimeo.com/video/114828162 Spider dress video]
| |
| ** [https://www.dezeen.com/2017/10/22/ying-gaos-dresses-become-animated-in-the-presence-of-strangers/ Ying Gaos dress]
| |
| ** [https://cutecircuit.com/wearable-technology/ Cute Circuit]
| |
| * [https://learn.adafruit.com/category/wearables Wearables od firmy Adafruit]
| |
| ** 1: [https://learn.adafruit.com/candle-flicker-hair-bow/ Mašľa]
| |
| ** 2: [https://learn.adafruit.com/sparkle-skirt/ Sukňa]
| |
| ** 3: [https://learn.adafruit.com/twinkling-led-parasol Dáždnik]
| |
| ** 4: [https://learn.adafruit.com/led-ampli-tie Kravata]
| |
| ** 5: [https://learn.adafruit.com/light-activated-pixel-heart/ Brošňa]
| |
|
| |
| == '''1. Krok za krokom''' ==
| |
|
| |
| == 1.1. '''Blink''' ==
| |
|
| |
| * [http://ap.urpi.fei.stuba.sk/sensorwiki/index.php/Acrob02 Blink]
| |
|
| |
| == 1.2. '''Železničné priecestie''' ==
| |
|
| |
| * [https://youtu.be/YaH8DJpeYs0?t=1m6s Video]
| |
|
| |
| == 1.3. '''K.I.T.T. 2000''' ==
| |
|
| |
| * [https://youtu.be/iQwlrEdka6Q?t=5s Video]
| |
|
| |
| == 1.4. Ak to nefunguje... ==
| |
|
| |
| ...tak [[Acrob Settings|skontrolujte nastavenia]].
| |
|
| |
| <BR>
| |
| <BR> | | <BR> |
| <BR> | | <BR> |
|
| |
| = '''2. A teraz už naozaj...''' =
| |
|
| |
|
| |
| == 2.1. Adafruit Gemma ==
| |
|
| |
| * [https://learn.adafruit.com/introducing-gemma/ Stránka u výrobcu so všetkými informáciami]
| |
|
| |
| [[Súbor:AdafruitGemma.png|500px|center]]
| |
|
| |
| V programovacom prostredí Arduino treba najprv nastaviť typ elektronickej dosky
| |
| na '''Adafruit Gemma 8MHz''' v menu Tools->Board.
| |
|
| |
| [[Súbor:flora_gemmaselect.gif|center]]
| |
|
| |
|
| |
| Potom ešte treba vybrať vhodný programovací protokol -
| |
| vyeberiete ho z menu Tools->Programmer->'''USBtinyISP'''
| |
|
| |
| [[Súbor:gemma_flora_selectusbtiny.gif|center]]
| |
|
| |
|
| |
| == 2.2. Blink ==
| |
|
| |
| Príklad čiapky s obyčajnými LED diódami - ukážka šitia: https://learn.adafruit.com/adafruit-led-sequins/
| |
|
| |
| Vyskúšame postupne jednoduché programy
| |
|
| |
| <source lang="Cpp">
| |
| /* 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);
| |
| }
| |
| </source>
| |
|
| |
|
| |
| <source lang="Cpp">
| |
| /* 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);
| |
|
| |
| }
| |
| </source>
| |
|
| |
|
| |
| Plynulá zmena intenzity svitu LED diody (funguje len na D0 a D1, na D2 NIE)
| |
|
| |
| <source lang="C">
| |
| int intenzita;
| |
|
| |
| void setup() {
| |
| intenzita = 0;
| |
| pinMode(2,OUTPUT);
| |
| }
| |
|
| |
| void loop() {
| |
| intenzita = 0;
| |
| for(int i=0; i<10 ; i++)
| |
| {
| |
| intenzita = intenzita + 25;
| |
| analogWrite(2,intenzita);
| |
| }
| |
|
| |
| }
| |
| </source>
| |
|
| |
| == 2.3. NeoPixel RGB ==
| |
|
| |
|
| |
| Priklady práce s inteligentnou RGB LED diódou [https://blog.adafruit.com/2013/08/30/adafruit-neopixel-uberguide/ Neopixel].
| |
|
| |
| Napríklad takáto [https://learn.adafruit.com/led-masquerade-masks/neopixel-gemma-mask maska na maškarný bál...]
| |
|
| |
| ToDo: niekoľko pekných ukážkových programov, ktoré by sa dali vlastne aplikovať aj na obyčajné diódy http://moving-rainbow.readthedocs.io/en/latest/guide/list-of-sample-programs/
| |
| Schéma pripojenia
| |
|
| |
| [[Súbor:AdafruitNeoPixelConnection.jpg]]
| |
|
| |
|
| |
| Základný príklad s jednou diódou
| |
|
| |
| <source lang="C">
| |
| #include <Adafruit_NeoPixel.h>
| |
|
| |
| #define PIN 1
| |
|
| |
| Adafruit_NeoPixel LED = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
| |
|
| |
| void setup() {
| |
|
| |
| LED.begin();
| |
| // LED.setPixelColor(n, red, green, blue);
| |
| LED.setPixelColor(0, 0, 0, 127);
| |
| LED.show(); // Show the preset color(s)
| |
| delay(2000);
| |
| LED.setBrightness(100);
| |
| }
| |
|
| |
| void loop() {
| |
| // n R G B
| |
| LED.setPixelColor(0, 255, 0, 127);
| |
| delay(2000);
| |
| LED.setPixelColor(0, 0 , 0, 0);
| |
| delay(2000);
| |
|
| |
| }
| |
|
| |
|
| |
|
| |
| </source>
| |
|
| |
| Základný príklad s dvoma diódami
| |
| <source lang="C">
| |
| #include <Adafruit_NeoPixel.h>
| |
|
| |
| #define PIN 1
| |
|
| |
| Adafruit_NeoPixel LED = Adafruit_NeoPixel(1, PIN, NEO_GRB + NEO_KHZ800);
| |
|
| |
| void setup() {
| |
|
| |
| LED.begin();
| |
| LED.show(); // Show the preset color(s)
| |
| LED.setBrightness(100); // Interval 0 - 255
| |
| }
| |
|
| |
| void loop() {
| |
|
| |
| // LED.setPixelColor(n, red, green, blue);
| |
| LED.setPixelColor(0, 255, 0, 0); // First LED Red
| |
| LED.setPixelColor(1, 0, 0, 127); // Second LED Blue
| |
| LED.show();
| |
| delay(300);
| |
| LED.setPixelColor(0, 0, 0, 127); // First LED Blue
| |
| LED.setPixelColor(1, 255, 0, 0); // Second LED Red
| |
| LED.show();
| |
| delay(300);
| |
|
| |
|
| |
| }
| |
| </source>
| |
|
| |
| A celkom na záver: ako prať elektronické odevy?
| |
| https://learn.adafruit.com/washing-wearable-electronics/hand-wash?view=all
| |
|
| |
|
|
| |
|
| === Technicke informacie ===
| |
|
| |
|
| * Adafruit Gemma Windows Driver: https://learn.adafruit.com/introducing-gemma/windows-setup
| | [[Category: AjTyvIT]] |
| * Adafruit Board Arduino Manager: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
| |
| * Neopixel Library: https://github.com/adafruit/Adafruit_NeoPixel
| |