Première version du code du minuteur et schéma d'implantation.

This commit is contained in:
2026-05-08 00:37:26 +02:00
parent da3fa03aff
commit 71753703e8
9 changed files with 825 additions and 0 deletions

102
minuteur/bitmaps.h Normal file
View File

@@ -0,0 +1,102 @@
/*----------------------------------------------------------------------
Project: InsoL@b
Author : user@B0 Tetalab.org
File : bitmaps.h 2025-05-21
This work is copyrighted under CERN Open Hardware Licence Version 2
------------------------------------------------------------------------
----------------------------------------------------------------------*/
#ifndef _INSOLAB_BITMAP_H_
#define _INSOLAB_BITMAP_H_
#define LOGO_COLOR 1 // display SSD1306 black
#define LOGO_X0 0 // logo bitmap width offset to center bitmap
#define LOGO_Y0 0 // logo bitmap height offset to center bitmap
#define LOGO_WIDTH 128
#define LOGO_HEIGHT 32
// logoBN128x32.png | 128x32 | 1-bit vertical bytes (LSB=top)
const unsigned char logo_bmp[] PROGMEM = {
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x0f,
0xa0, 0x02, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe8, 0x0f, 0xff, 0xff, 0xff, 0xe8, 0x0f,
0x80, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0x0f, 0xff, 0xff, 0xff, 0xe0, 0x0f,
0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x81, 0xff, 0xff, 0xff, 0xe3, 0x81,
0xfe, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0x81, 0xff, 0xff, 0xff, 0xe3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e8, 0x0f,
0x80, 0x00, 0xc7, 0xfc, 0x60, 0x00, 0x30, 0x00, 0x03, 0xe0, 0x01, 0x80, 0x00, 0x03, 0xe0, 0x0f,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// RTTTL sounds
#include <anyrtttl.h>
#include <binrtttl.h>
#include <pitches.h>
const char * _missip1_=
"mip:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f";
const char * _count_=
"Pacman:d=32,o=6,b=112:b.5,b.,f#.,d#.,b.,f#.,16p,16d#,c.,c.7,g.,e.,c.7,g.,16p,16e,b.5,b.,f#.,d#.,b.,f#.";
const char * _finish_=
"LightMyFire:d=4,o=5,b=140:8b,16g,16a,8b,8d6,8c6,8b,8a,8g,8a,16f,16a,8c6,8f6,16d6,16c6,16a#,16g,8g#,8g,8g#,16g,16a,8b,8c#6,16b,16a,16g,16f,8e,8f,1a,a";
const char * _logo_ = "Star Trek:o=5,d=16,b=63,b=63:8f.,a#,4d#6.,8d6,a#.,g.,c6.,4f6";
const char * _neon_ =
"Neonligh:d=4,o=5,b=100:8e#7,16p,16d#7,8d#7,8p,16c#7,8c#6,16a#6,8e#7,16p,16d#7,8d#7,8p,8c#7,16a#6,8e#7,16p,16a#6,8a#6,8p,16c#7,8d#7,16e#7,8e#7,16p,8d#7";
void playRTTTL (screen_t itune){
//#ifdef SOUND_ON
switch (itune) { // ugly code to manage SOUND off
case sNONE : noTone(PIEZO); // PIEZO defined in main
return;
case sLOGO : anyrtttl::blocking::play(PIEZO, _logo_); break;
case sTITRE : ; break; //rtune = _missip1_
case sCHOIX : anyrtttl::blocking::play(PIEZO, _neon_); break;
case sEXPOS : anyrtttl::blocking::play(PIEZO, _finish_); break;
case sREGLE : ; break; //tune = _count_
default : ; break;
}
}
/*
// flower
static const unsigned char PROGMEM flower_bmp[] = {
0b00000000, 0b11000000,
0b00000001, 0b11000000,
0b00000001, 0b11000000,
0b00000011, 0b11100000,
0b11110011, 0b11100000,
0b11111110, 0b11111000,
0b01111110, 0b11111111,
0b00110011, 0b10011111,
0b00011111, 0b11111100,
0b00001101, 0b01110000,
0b00011011, 0b10100000,
0b00111111, 0b11100000,
0b00111111, 0b11110000,
0b01111100, 0b11110000,
0b01110000, 0b01110000,
0b00000000, 0b00110000 };
*/
#endif // _INSOLAB_BITMAP_H_