This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Récupération de la description | |
description_raw = msg.payload.split("SUMMARY:"); | |
var description = []; | |
description_raw.forEach(function (item, index) { | |
if(index !== 0){ | |
description.push(item.split("\n")[0].trim()); | |
} | |
}); | |
// Récupération de la date |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
drawAnimation(); | |
if (animation_direction) { | |
animation_state--; | |
} else { | |
animation_state++; | |
} | |
if (animation_state == 5) { | |
animation_direction = true; | |
} | |
if (animation_state == 0) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void drawAnimation() { | |
u8g2.firstPage(); | |
do { | |
switch (animation_state) { | |
case 0: | |
u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_1); | |
break; | |
case 1: | |
u8g2.drawXBMP(0, 0, logo_width, logo_height, logo_2); | |
break; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() { | |
if (tick.isExpired()) { | |
drawAnimation(); | |
pos_x = pos_x + X; | |
if (pos_x > OLED_WIDTH + cannon_width) { | |
pos_x = -cannon_width; | |
} | |
tick.repeat(); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <AsyncDelay.h> | |
const int FPS = 1000 / 30; //30 FPS | |
AsyncDelay tick; void setup(){ | |
tick.start(FPS, AsyncDelay::MILLIS); | |
} | |
void loop(){ | |
if(tick.isExpired()){ | |
//ANIMATION ICI | |
tick.repeat(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> //I2C | |
#include <U8g2lib.h> | |
#include "logo.h" | |
//I2C SSD1306 128x32 (search U8g2 examples for other display) | |
U8G2_SSD1306_128X32_UNIVISION_F_HW_I2C u8g2(U8G2_R0, U8X8_PIN_NONE); | |
void setup() { | |
u8g2.begin(); //Start Screen | |
drawLogo(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define logo_width 128 | |
#define logo_height 32 | |
static const unsigned char logo[] U8X8_PROGMEM = { | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00... | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define _width 128 | |
#define _height 32 | |
static char _bits[] = { | |
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00... | |
}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Auteur : Remi Sarrailh (maditnerd) | |
# Updates : Modifications mineures par Valentin CARRUESCO Idleman 28/07/2018 | |
# Licence : MIT | |
# Un probleme : https://git.idleman.fr/idleman/yana-server/issues | |
# https://tldrlegal.com/license/mit-license | |
############# | |
# Variables | |
############# |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Date and time functions using a DS1307 RTC connected via I2C and Wire lib | |
#include <Wire.h> | |
#include "RTClib.h" | |
RTC_DS1307 rtc; | |
DateTime horloge; | |
int pin_relai_1 = 13; | |
int pin_relai_2 = 11; | |
//Scenario 1 |