Différences
Ci-dessous, les différences entre deux révisions de la page.
| Les deux révisions précédentes Révision précédente Prochaine révision | Révision précédente | ||
|
projets:panneau_poplab [20/10/2017 21:02] Mathieu Hery [Fichiers] |
projets:panneau_poplab [11/04/2018 11:10] (Version actuelle) Mathieu Hery [Fichiers] |
||
|---|---|---|---|
| Ligne 11: | Ligne 11: | ||
| {{:projets:panneau-poplab.jpg?400|}} | {{:projets:panneau-poplab.jpg?400|}} | ||
| {{:projets:panneau-detail.jpg?400|}} | {{:projets:panneau-detail.jpg?400|}} | ||
| + | {{:projets:croquis-open-closed.jpg?400|}} | ||
| ---- | ---- | ||
| Ligne 32: | Ligne 33: | ||
| ==== Fichiers ==== | ==== Fichiers ==== | ||
| - | *[[http://poplab.maisonpop.fr/ressources/templates-panneau.zip|Fichiers template]] | + | *[[http://poplab.maisonpop.fr/ressources/panneau-poplab/templates-panneau-poplab.zip|Fichiers template]] |
| + | |||
| + | ^ Photo ^ Type ^ Fichier SVG ^ Fichier DXF ^ | ||
| + | | {{:projets:bloc-imp-3D.jpg?200|}} | Bloc 1/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-3d.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-3d.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-cnc.jpg?200|}} | Bloc 2/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-CNC.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-CNC.dxf|Fichier DXF]] | | ||
| + | | {{:projets:Bloc-formations-x3.jpg?200|}} | Bloc 2/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-formations-x3.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-formations-x3.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-laser.jpg?200|}} | Bloc 2/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-laser.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-laser.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-infos.jpg?200|}} | Bloc 1/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-pop-lab-infos.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-pop-lab-infos.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-date.jpg?200|}} | Gabarit spécial | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-repare-pop-date.svg|Fichier SVG]] | N/A | | ||
| + | | {{:projets:Bloc-formations-x3.jpg?200|}} | Bloc 2/3 | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-repare-pop-explications.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Bloc-repare-pop-explications.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-repare-pop-annonce.jpg?200|}} | Footer | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Footer-repare-pop-annonce.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Footer-repare-pop-annonce.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-poplab-2016.jpg?200|}} | Header | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-2016.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-2016.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-poplab-2017.jpg?200|}} | Header | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-2017.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-2017.dxf|Fichier DXF]] | | ||
| + | | {{:projets:Header-repare-pop.jpg?200|}} | Header | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-repare-pop.svg|Fichier SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-repare-pop.dxf|Fichier DXF]] | | ||
| + | | {{:projets:bloc-pop-open-closed.jpg?200|}} | Header - attention taille des encoches mauvaises | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-electronique.svg|Fond SVG]] - [[http://poplab.maisonpop.fr/ressources/panneau-poplab/caseplans-panneau-ouvert-ferme.svg|Boîte SVG]] | [[http://poplab.maisonpop.fr/ressources/panneau-poplab/Header-poplab-electronique.dxf|Fond DXF]] - [[http://poplab.maisonpop.fr/ressources/panneau-poplab/caseplans-panneau-ouvert-ferme.dxf|Boîte DXF]] - [[http://poplab.maisonpop.fr/ressources/panneau-poplab/panneau-ouvert-ferme-box.dxf|Face avant DXF]] | | ||
| + | |||
| + | ++++ Code (fallback) | | ||
| + | <code c> | ||
| + | /* Sketch created for an Open/closed sign for Pop [lab] Montreuil | ||
| + | |||
| + | An Arduino connects to 2 Pololu Led strips, 12 leds long | ||
| + | A switch toggles between which one is lit | ||
| + | |||
| + | Fallback mode only rainbow mode | ||
| + | |||
| + | mh8 - February 2018 | ||
| + | |||
| + | */ | ||
| + | |||
| + | #include <PololuLedStrip.h> | ||
| + | |||
| + | // Create 2 ledStrip objects on pin 10 & 12 | ||
| + | PololuLedStrip<12> ledStripOpen; | ||
| + | PololuLedStrip<10> ledStripClosed; | ||
| + | |||
| + | // Create two buffers to hold the colors on the ledStrips | ||
| + | #define LED_COUNT 12 | ||
| + | rgb_color colorsOpen[LED_COUNT]; | ||
| + | rgb_color colorsClosed[LED_COUNT]; | ||
| + | rgb_color colors[LED_COUNT]; | ||
| + | rgb_color colorsOff[LED_COUNT]; | ||
| + | |||
| + | // A switch button toggles On/Off | ||
| + | const uint8_t buttonPin = 2; | ||
| + | uint8_t buttonState = 0; | ||
| + | |||
| + | // A push button selects between different modes | ||
| + | // Use a 4.7K pullup resistor to connect the pin to the 5V | ||
| + | const uint8_t switchPin = 4; | ||
| + | uint8_t switchSelect = 0; | ||
| + | |||
| + | //Variable for delays (can go up to 65536 on 2 bytes) | ||
| + | uint16_t interval = 10; | ||
| + | |||
| + | //Variable defining maximum number of modes. Count starts at 0. | ||
| + | //This value should be 1 more than the number of the last mode | ||
| + | uint8_t maxModes = 3; | ||
| + | |||
| + | void setup() { | ||
| + | |||
| + | pinMode(buttonPin, INPUT); | ||
| + | pinMode(switchPin, INPUT); | ||
| + | |||
| + | Serial.begin(115200); | ||
| + | |||
| + | //Initialize all arrays to off | ||
| + | for (int i = 0; i < LED_COUNT; i++) | ||
| + | { | ||
| + | colors[i] = colorsOff[i] = rgb_color(0, 0, 0); | ||
| + | } | ||
| + | } | ||
| + | |||
| + | void loop() { | ||
| + | |||
| + | //In this mode we need to know if we address the OPEN or the CLOSED ledStrip | ||
| + | int buttonState = digitalRead(buttonPin); | ||
| + | |||
| + | // Update the colors (comes from LedStripRainbow example) | ||
| + | uint16_t time = millis() >> 2; | ||
| + | for (uint16_t i = 0; i < LED_COUNT; i++) | ||
| + | { | ||
| + | byte x = (time >> 2) - (i << 3); | ||
| + | colors[i] = hsvToRgb((uint32_t)x * 359 / 256, 255, 255); | ||
| + | } | ||
| + | |||
| + | if (buttonState == 1) { | ||
| + | // Write to OPEN not to CLOSED | ||
| + | ledStripOpen.write(colors, LED_COUNT); | ||
| + | ledStripClosed.write(colorsOff, LED_COUNT); | ||
| + | } | ||
| + | |||
| + | else if (buttonState == 0) { | ||
| + | // Write to CLOSED not to OPEN | ||
| + | ledStripClosed.write(colors, LED_COUNT); | ||
| + | ledStripOpen.write(colorsOff, LED_COUNT); | ||
| + | } | ||
| + | delay(interval); | ||
| + | |||
| + | } | ||
| + | |||
| + | // Comes from LedStripRainbow example | ||
| + | // Converts a color from HSV to RGB. | ||
| + | // h is hue, as a number between 0 and 360. | ||
| + | // s is the saturation, as a number between 0 and 255. | ||
| + | // v is the value, as a number between 0 and 255. | ||
| + | rgb_color hsvToRgb(uint16_t h, uint8_t s, uint8_t v) | ||
| + | { | ||
| + | uint8_t f = (h % 60) * 255 / 60; | ||
| + | uint8_t p = (255 - s) * (uint16_t)v / 255; | ||
| + | uint8_t q = (255 - f * (uint16_t)s / 255) * (uint16_t)v / 255; | ||
| + | uint8_t t = (255 - (255 - f) * (uint16_t)s / 255) * (uint16_t)v / 255; | ||
| + | uint8_t r = 0, g = 0, b = 0; | ||
| + | switch ((h / 60) % 6) { | ||
| + | case 0: r = v; g = t; b = p; break; | ||
| + | case 1: r = q; g = v; b = p; break; | ||
| + | case 2: r = p; g = v; b = t; break; | ||
| + | case 3: r = p; g = q; b = v; break; | ||
| + | case 4: r = t; g = p; b = v; break; | ||
| + | case 5: r = v; g = p; b = q; break; | ||
| + | } | ||
| + | return rgb_color(r, g, b); | ||
| + | } | ||
| + | </code> | ||
| + | |||
| + | ++++ | ||
| //Projet réalisé par Mathieu Hery// | //Projet réalisé par Mathieu Hery// | ||
