Aj Ty v IT: Rozdiel medzi revíziami
Zo stránky SensorWiki
Bez shrnutí editace |
|||
Riadok 26: | Riadok 26: | ||
** [https://player.vimeo.com/video/114828162 Spider dress video] | ** [https://player.vimeo.com/video/114828162 Spider dress video] | ||
** [https://www.youtube.com/watch?v=RkHnmhWYojo Cognitive Dress by Marchesa and IBM Watson] ([https://www.ibm.com/blogs/think/2016/04/watson-and-marchesa/ read more...]) | ** [https://www.youtube.com/watch?v=RkHnmhWYojo Cognitive Dress by Marchesa and IBM Watson] ([https://www.ibm.com/blogs/think/2016/04/watson-and-marchesa/ read more...]) | ||
** [https://chromat.co/blogs/news/63131779-chromat-ss16-momentum Smart športová podprsenka] | |||
** [https://www.dezeen.com/2017/10/22/ying-gaos-dresses-become-animated-in-the-presence-of-strangers/ Ying Gaos dress] | ** [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://cutecircuit.com/wearable-technology/ Cute Circuit] |
Verzia z 11:06, 15. december 2017
![](/sensorwiki/images/thumb/7/76/LogoAjTyvIT.png/150px-LogoAjTyvIT.png)
Svetielkujúci Workshop 18. 12. 2017
- Svetielkujuci Workshop 1 (jún 2017)
Úvod
1. Krok za krokom
1.1. Blink
1.2. Železničné priecestie
1.3. K.I.T.T. 2000
1.4. Ak to nefunguje...
...tak skontrolujte nastavenia.
2. A teraz už naozaj...
2.1. 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)
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
/* 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);
}
Plynulá zmena intenzity svitu LED diody (funguje len na D0 a D1, na D2 NIE)
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);
}
}
2.3. NeoPixel RGB
Priklady práce s inteligentnou RGB LED diódou Neopixel.
Napríklad takáto 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
Základný príklad s jednou diódou
#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);
}
Základný príklad s dvoma diódami
#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);
}
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
- Adafruit Board Arduino Manager: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
- Neopixel Library: https://github.com/adafruit/Adafruit_NeoPixel