====== ToTEM - Partie technique ======
* Porteur du projet : reso / La Nouvelle Vague Creative
* Date : 19/03/2021/ - ...
* Description : Totem multimédia pour les bébés
* Lien : [[http://lanouvellevaguecreative.net/la-saison-2-dartin-box-cest-reparti/|Projet Art'in Box]]
* file : {{ :projets:totem:design-cnc.zip |design-cnc (en cours)}}
* Arduino : {{ :projets:totem:28byj-48_uln2003-pot-dir2.zip |ULN2003 bidirectional motor}}
===== STRUCTURE =====
{{:projets:totem:design-structure-totem.png|}}
=== Structure Aluminium ===
[[https://www.sodeficoncept.fr/fr/lean-modulaire/composants|Sodefi 35mm]]
===== OPTIQUES =====
* 5 bagues macro x8 52mm (a visser les une sur les autres)[[https://fr.aliexpress.com/item/32668063115.html?src=google&src=google&memo1=freelisting&albch=shopping&acnt=248-630-5778&isdl=y&slnk=&plac=&mtctp=&albbt=Google_7_shopping&aff_platform=google&aff_short_key=UneMJZVf&albagn=888888&isSmbAutoCall=false&needSmbHouyi=false&albcp=10191220526&albag=107473525328&trgt=539263010115&crea=fr32668063115&netw=u&device=c&albpg=539263010115&albpd=fr32668063115&gclid=Cj0KCQiAsqOMBhDFARIsAFBTN3dteGhPUyKkY5R2tUIOI5UkuRMXNAJkozii9qWSC5Ip41D6X5t0R4oaAh-AEALw_wcB&gclsrc=aw.ds|Bague Filtre Macro +8]]
* [[https://www.thomann.de/fr/stairville_led_par_64_cob_rgbw_60w.htm|Spot DMX 60W LED COB]]
===== CONNECT =====
// SSH
* ssh -Y pi@192.168.43.195
// ACCES FILES
* sftp://pi@192.168.43.195/home/pi/Documents/malinette/
// DEPOT PATCHES
* sftp://pi@192.168.43.195/home/pi/Documents/malinette/malinette-ide/projects/malinette-default/
===== ELECTRONIQUE =====
{{:projets:totem:totem-dev-electro1.png|}}
===ARDUINO ULN2003 STEPPER BI-DIRECTIONNAL===
++++ code stepper.h|
#include
const int stepsPerRevolution = 200;
Stepper myStepper(stepsPerRevolution, 8, 10, 9, 11);
int currentVal;
int lastVal;
int motorSpeed;
void setup() {
Serial.begin(9600);
}
void loop() {
int currentval = analogRead(A0);
if (currentval >= lastVal + 5 || currentVal <= lastVal + 5)
{
motorSpeed = map(currentval, 0, 1023, 0, 100);
Serial.println(motorSpeed);
}
lastVal = currentVal;
if (motorSpeed < 49) {
myStepper.setSpeed( 49 - motorSpeed);
myStepper.step(stepsPerRevolution / 100);
}
else if (motorSpeed > 51) {
myStepper.setSpeed( motorSpeed - 51);
myStepper.step(-stepsPerRevolution / 100);
}
}
++++
=== ARDUINO FAST LEDS ===
++++ Attribution des id Leds|
// distribution par panneaux
int NB_LEDS_per_P = 13;
int P1b[] = { 0,1,2,3,4,5,6,7,8,9,10,11,12}; // p1 - Flore bas
int P1h[] = { 51,50,49,48,47,46,45,44,43,42,41,40,39}; // p1 - Flore haut
//
int P2b[] = { 13,14,15,16,17,18,19,20,21,22,23,24,25}; // p2 - Cosmos bas
int P2h[] = { 38,37,36,35,34,33,32,31,30,29,28,27,26}; // p2 - Cosmos haut
//
int P3b[] = { 26,27,28,29,30,31,32,33,34,35,36,37,38}; // p3 - Faune bas
int P3h[] = { 25,24,23,22,21,20,19,18,17,16,15,14,13}; // p3 - Faune haut
//
int P4b[] = { 39,40,41,42,43,44,45,46,47,48,49,50,51}; // p4 - Sapiens bas
int P4h[] = { 12,11,10,9,8,7,6,5,4,3,2,1,0}; // p4 - Sapiens haut
//
int Menu[] = { 60,61,62,63,65,66}; // Menu Zen / accueil / Jeu (par groupe de 2 leds)
int *curr_Pxb;
int *curr_Pxh;
//
int currentZenHue;
//
int hues[] = { 50, 100, 200 }; // default hue values
int currentFPS = 80;
void setup() {
delay(2000); // delay for recovery
// Setup leds array
FastLED.addLeds(leds[0], NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.addLeds(leds[2], NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.addLeds(leds[1], NUM_LEDS).setCorrection(TypicalLEDStrip);
// Setup color par panneaux
for (int i = 0; i < NB_LEDS_per_P; i++)
{
// P1 Flore
leds[0][P1b[i]] = CRGB::Green;
leds[1][P1h[i]] = CRGB::Green;
// P2 Cosmos
leds[0][P2b[i]] = CRGB::White;
leds[1][P2h[i]] = CRGB::White;
// P3 Faune
leds[0][P3b[i]] = CRGB::Yellow;
leds[1][P3h[i]] = CRGB::Yellow;
// P4 Sapiens
leds[0][P4b[i]] = CRGB::Blue;
leds[1][P4h[i]] = CRGB::Blue;
//
FastLED.setBrightness(10);
}
// MENU ZEN
leds[1][60] = CRGB::Blue;
leds[1][61] = CRGB::Blue;
// MENU MED
leds[1][62] = CRGB::White;
leds[1][63] = CRGB::White;
// MENU JEU
leds[1][65] = CRGB::Red;
leds[1][66] = CRGB::Red;
//
FastLED.setBrightness(10);
FastLED.show();
// Serial communication
Serial.begin(BAUD_RATE);
}
++++
----