+LEDs RGB, fix Brightness input
This commit is contained in:
parent
268be2953b
commit
471bfbe6ac
@ -13,17 +13,25 @@
|
|||||||
#include <RTClib.h> // Date and time functions using a DS1307 RTC connected via I2C and Wire lib. https://github.com/adafruit/RTClib
|
#include <RTClib.h> // Date and time functions using a DS1307 RTC connected via I2C and Wire lib. https://github.com/adafruit/RTClib
|
||||||
#include <NTP.h> // The NTP library allows you to receive time information from the Internet. https://github.com/sstaub/NTP
|
#include <NTP.h> // The NTP library allows you to receive time information from the Internet. https://github.com/sstaub/NTP
|
||||||
#include "nixie.h" // Mes routines de pilotage d'affichage Nixie
|
#include "nixie.h" // Mes routines de pilotage d'affichage Nixie
|
||||||
|
#include <FastLED.h>
|
||||||
|
|
||||||
|
// Number of leds in your strip
|
||||||
|
#define NUM_LEDS 4
|
||||||
|
#define LEDS_PIN 43
|
||||||
|
// Define the array of leds
|
||||||
|
CRGB leds[NUM_LEDS];
|
||||||
|
|
||||||
RTC_DS1307 rtc;
|
RTC_DS1307 rtc;
|
||||||
char daysOfTheWeek[7][12] = { "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" };
|
char daysOfTheWeek[7][12] = { "Dimanche", "Lundi", "Mardi", "Mercredi", "Jeudi", "Vendredi", "Samedi" };
|
||||||
int timeout = 120; // seconds to run for trying wifi connexion
|
|
||||||
bool wifiOK, ntpOK, rtcOK;
|
bool wifiOK, ntpOK, rtcOK;
|
||||||
unsigned long LastRTCUpdate; // le temps de dernière MAJ de l'horloge interne RTC
|
unsigned long LastRTCUpdate; // le temps de dernière MAJ de l'horloge interne RTC
|
||||||
unsigned long LastNixieUpdate; // le temps de dernière MAJ affichage Nixie
|
unsigned long LastNixieUpdate; // le temps de dernière MAJ affichage Nixie
|
||||||
|
unsigned long LastDotUpdate; // le temps de dernière MAJ de l'affichage du point des secondes
|
||||||
int heu_d, heu_u, min_d, min_u, sec_d, sec_u;
|
int heu_d, heu_u, min_d, min_u, sec_d, sec_u;
|
||||||
|
int brightnessInput, brightnessLeds ; //for RGB led brightness
|
||||||
|
|
||||||
const long intervalRTCUpdate = 3600000; // 86400000 = 24 heures / 3600000 = 1 heure
|
const long intervalRTCUpdate = 3600000; // 86400000 = 24 heures / 3600000 = 1 heure
|
||||||
const long intervalNixieUpdate = 2000; // 1000 = 1 seconde
|
const long intervalNixieUpdate = 1000; // 1000 = 1 seconde
|
||||||
|
|
||||||
WiFiUDP wifiUdp;
|
WiFiUDP wifiUdp;
|
||||||
NTP ntp(wifiUdp);
|
NTP ntp(wifiUdp);
|
||||||
@ -33,28 +41,31 @@ NTP ntp(wifiUdp);
|
|||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
//
|
//
|
||||||
bool initWIFI() {
|
bool initWIFI() {
|
||||||
// is configuration portal requested?
|
|
||||||
|
//WiFi.mode(WIFI_STA); // explicitly set mode, esp defaults to STA+AP
|
||||||
WiFiManager wm;
|
WiFiManager wm;
|
||||||
|
bool reso;
|
||||||
|
|
||||||
wm.setConfigPortalTimeout(60);
|
wm.setConfigPortalTimeout(60);
|
||||||
wm.setHostname("HorlogeNixie");
|
wm.setHostname("HorlogeNixie");
|
||||||
|
|
||||||
bool res;
|
//reset settings if switch pressed on startup
|
||||||
//reset settings on startup if switch pressed
|
|
||||||
if (!digitalRead(Rotary_SW)) {
|
if (!digitalRead(Rotary_SW)) {
|
||||||
Serial.println("RAZ");
|
Serial.println("RAZ wifi");
|
||||||
wm.resetSettings();
|
wm.resetSettings();
|
||||||
}
|
}
|
||||||
res = wm.autoConnect("NixieClockAP"); // Création d'un AP ou connexion mémorisée
|
|
||||||
|
|
||||||
if(!res) {
|
reso = wm.autoConnect("NixieClockAP"); // Création d'un AP ou connexion mémorisée
|
||||||
|
//reso = wm.autoConnect(SECRET_WIFI_SSID, SECRET_WIFI_PASS);
|
||||||
|
|
||||||
|
if (reso) {
|
||||||
|
//if you get here you have connected to the WiFi
|
||||||
|
Serial.println("Connected...yeey :)");
|
||||||
|
} else {
|
||||||
Serial.println("Failed to connect");
|
Serial.println("Failed to connect");
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
//if you get here you have connected to the WiFi
|
|
||||||
Serial.println("connected...yeey :)");
|
|
||||||
}
|
|
||||||
|
|
||||||
return(res);
|
return (reso);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool initRTC() {
|
bool initRTC() {
|
||||||
@ -67,13 +78,11 @@ bool initRTC(){
|
|||||||
if (!rtc.begin()) {
|
if (!rtc.begin()) {
|
||||||
Serial.println(" --> RTC introuvable !");
|
Serial.println(" --> RTC introuvable !");
|
||||||
return (false);
|
return (false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Serial.println(" : OK");
|
Serial.println(" : OK");
|
||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
Serial.println(" : déjà démarrée !");
|
Serial.println(" : déjà démarrée !");
|
||||||
return (true);
|
return (true);
|
||||||
}
|
}
|
||||||
@ -153,6 +162,12 @@ void setup () {
|
|||||||
Serial.println("");
|
Serial.println("");
|
||||||
Serial.println("Liaison série OK");
|
Serial.println("Liaison série OK");
|
||||||
|
|
||||||
|
//// Initialisation des LEDs RGB
|
||||||
|
FastLED.addLeds<WS2812B, LEDS_PIN, RGB>(leds, NUM_LEDS); // GRB ordering is typical
|
||||||
|
FastLED.setBrightness(16);
|
||||||
|
leds[0] = CRGB::Black;
|
||||||
|
FastLED.show();
|
||||||
|
|
||||||
wifiOK = initWIFI(); // initialisation du wifi
|
wifiOK = initWIFI(); // initialisation du wifi
|
||||||
initNTP(); // récupération du temps Internet
|
initNTP(); // récupération du temps Internet
|
||||||
rtcOK = initRTC(); // initialisation de l'horloge interne
|
rtcOK = initRTC(); // initialisation de l'horloge interne
|
||||||
@ -164,11 +179,11 @@ void setup () {
|
|||||||
}
|
}
|
||||||
Serial.print("Pour info, le temps de compil : ");
|
Serial.print("Pour info, le temps de compil : ");
|
||||||
Serial.print(__DATE__);
|
Serial.print(__DATE__);
|
||||||
|
Serial.print(" - ");
|
||||||
Serial.println(__TIME__);
|
Serial.println(__TIME__);
|
||||||
Serial.println("Fin des initialisations.");
|
Serial.println("Fin des initialisations.");
|
||||||
printRTC(); // Affichage du temps RTC en console série
|
printRTC(); // Affichage du temps RTC en console série
|
||||||
Serial.println("------------------------");
|
Serial.println("------------------------");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/////////////////////////////////////////////////////
|
/////////////////////////////////////////////////////
|
||||||
@ -189,16 +204,32 @@ void loop () {
|
|||||||
min_u = (now.minute()) % 10;
|
min_u = (now.minute()) % 10;
|
||||||
sec_d = (now.second()) / 10;
|
sec_d = (now.second()) / 10;
|
||||||
sec_u = (now.second()) % 10;
|
sec_u = (now.second()) % 10;
|
||||||
|
|
||||||
|
printRTC();
|
||||||
|
|
||||||
|
brightnessInput = analogRead(IN_PHOTO_R); // read the input pin
|
||||||
|
FastLED.setBrightness(brightnessInput/16);
|
||||||
|
|
||||||
|
int aupif = random(0, 4);
|
||||||
|
int randomR = random(255);
|
||||||
|
int randomG = random(255);
|
||||||
|
int randomB = random(255);
|
||||||
|
leds[aupif] = CRGB(randomR, randomG, randomB);
|
||||||
|
FastLED.show();
|
||||||
}
|
}
|
||||||
|
|
||||||
// allumage du point une demi-seconde par seconde
|
// allumage du point une seconde puis éteint une seconde
|
||||||
// utilisation du digit "9" du Nixie 3 (dizaines de minutes)
|
// utilisation du digit "9" du Nixie 3 (dizaines de minutes)
|
||||||
if (currentMillis - LastNixieUpdate < 1000) {
|
if ((currentMillis - LastDotUpdate < 1000) || (currentMillis < LastDotUpdate)) {
|
||||||
printNixie3(9);
|
printNixie3(9);
|
||||||
delay(5);
|
delay(5);
|
||||||
digitalWrite(NX3A, 0); //Switch OFF Anode Nixie 1
|
digitalWrite(NX3A, 0); //Switch OFF Anode Nixie 1
|
||||||
} else {
|
} else {
|
||||||
|
if ((currentMillis - LastDotUpdate < 2000) || (currentMillis < LastDotUpdate)) {
|
||||||
delay(5);
|
delay(5);
|
||||||
|
} else {
|
||||||
|
LastDotUpdate = currentMillis;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
printNixie1(heu_d);
|
printNixie1(heu_d);
|
||||||
@ -217,8 +248,6 @@ void loop () {
|
|||||||
delay(5);
|
delay(5);
|
||||||
digitalWrite(NX4A, 0); //Switch OFF Anode Nixie 1
|
digitalWrite(NX4A, 0); //Switch OFF Anode Nixie 1
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Mise à jour de l'horloge interne RTC. Une fois par 24H
|
// Mise à jour de l'horloge interne RTC. Une fois par 24H
|
||||||
if ((currentMillis - LastRTCUpdate >= intervalRTCUpdate) || (currentMillis < LastRTCUpdate)) {
|
if ((currentMillis - LastRTCUpdate >= intervalRTCUpdate) || (currentMillis < LastRTCUpdate)) {
|
||||||
LastRTCUpdate = currentMillis;
|
LastRTCUpdate = currentMillis;
|
||||||
|
@ -18,7 +18,7 @@ NTP - The NTP library allows you to receive time information from the In
|
|||||||
|
|
||||||
## TODO :
|
## TODO :
|
||||||
Gestion des erreurs
|
Gestion des erreurs
|
||||||
- [X] WiFi : utiliser le Wifi Manager https://github.com/tzapu/WiFiManager
|
- [En cours] WiFi : utiliser le Wifi Manager https://github.com/tzapu/WiFiManager
|
||||||
- [X] RTC : en cas d'echec de récupération du temps Internet
|
- [X] RTC : en cas d'echec de récupération du temps Internet
|
||||||
- [ ] Pas/Perte de réseau
|
- [ ] Pas/Perte de réseau
|
||||||
- [ ]
|
- [ ]
|
||||||
@ -26,8 +26,9 @@ Gestion des erreurs
|
|||||||
Fonctionnalités
|
Fonctionnalités
|
||||||
- [X] Remise à zéro par pression d'un BP au démarrage : config Wifi,
|
- [X] Remise à zéro par pression d'un BP au démarrage : config Wifi,
|
||||||
- [X] Syncro de l'heure par internet et prise en compte heure d'été
|
- [X] Syncro de l'heure par internet et prise en compte heure d'été
|
||||||
- [ ] affichage de l'heure sur Nixie
|
- [X] affichage de l'heure sur Nixie
|
||||||
|
- [En cours] Effets lumineux sur leds RGB
|
||||||
- [ ] ajustement de l'heure par encodeur rotatif
|
- [ ] ajustement de l'heure par encodeur rotatif
|
||||||
- [ ] alarme réveil par buzer/HP ?
|
- [ ] Traitement parallélisé (synchro NTP via réso // affichage de l'heure)
|
||||||
- [ ]
|
- [ ]
|
||||||
- [ ]
|
- [ ]
|
||||||
|
14
debug.cfg
Normal file
14
debug.cfg
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
||||||
|
#
|
||||||
|
# Example OpenOCD configuration file for ESP32-S3 connected via builtin USB-JTAG adapter.
|
||||||
|
#
|
||||||
|
# For example, OpenOCD can be started for ESP32-S3 debugging on
|
||||||
|
#
|
||||||
|
# openocd -f board/esp32s3-builtin.cfg
|
||||||
|
#
|
||||||
|
|
||||||
|
# Source the JTAG interface configuration file
|
||||||
|
source [find interface/esp_usb_jtag.cfg]
|
||||||
|
# Source the ESP32-S3 configuration file
|
||||||
|
source [find target/esp32s3.cfg]
|
||||||
|
|
17
debug_custom.json
Normal file
17
debug_custom.json
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
{
|
||||||
|
"name":"Arduino on ESP32-S3",
|
||||||
|
"toolchainPrefix":"xtensa-esp32s3-elf",
|
||||||
|
"svdFile":"debug.svd",
|
||||||
|
"request":"attach",
|
||||||
|
"overrideAttachCommands":[
|
||||||
|
"set remote hardware-watchpoint-limit 2",
|
||||||
|
"monitor reset halt",
|
||||||
|
"monitor gdb_sync",
|
||||||
|
"thb setup",
|
||||||
|
"c"
|
||||||
|
],
|
||||||
|
"overrideRestartCommands":[
|
||||||
|
"monitor reset halt",
|
||||||
|
"monitor gdb_sync"
|
||||||
|
]
|
||||||
|
}
|
@ -18,6 +18,8 @@
|
|||||||
// sortie pilotage des LEDs WS2812B placées sous les Nixies
|
// sortie pilotage des LEDs WS2812B placées sous les Nixies
|
||||||
#define OUT_LEDs 43
|
#define OUT_LEDs 43
|
||||||
|
|
||||||
|
// Entrée photo-résistance
|
||||||
|
#define IN_PHOTO_R 10
|
||||||
|
|
||||||
// Touches
|
// Touches
|
||||||
#define Rotary_A 35
|
#define Rotary_A 35
|
||||||
|
88
nixie.cpp
88
nixie.cpp
@ -10,72 +10,72 @@ void printNixie1(int8_t a){
|
|||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX1A, 1); //Switch on Anode Nixie 1
|
digitalWrite(NX1A, 1); //Switch ON Anode Nixie 1
|
||||||
break;
|
break;
|
||||||
case 99:
|
default:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
@ -92,72 +92,72 @@ void printNixie2(int8_t a){
|
|||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX2A, 1); //Switch on Anode Nixie 2
|
digitalWrite(NX2A, 1); //Switch ON Anode Nixie 2
|
||||||
break;
|
break;
|
||||||
case 99:
|
default:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
@ -174,72 +174,72 @@ void printNixie3(int8_t a){
|
|||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX3A, 1); //Switch on Anode Nixie 3
|
digitalWrite(NX3A, 1); //Switch ON Anode Nixie 3
|
||||||
break;
|
break;
|
||||||
case 99:
|
default:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
@ -256,72 +256,72 @@ void printNixie4(int8_t a){
|
|||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 1:
|
case 1:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 2:
|
case 2:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 4:
|
case 4:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 7:
|
case 7:
|
||||||
digitalWrite(BCD_D, LOW); //D
|
digitalWrite(BCD_D, LOW); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 8:
|
case 8:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, LOW); //A
|
digitalWrite(BCD_A, LOW); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 9:
|
case 9:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, LOW); //C
|
digitalWrite(BCD_C, LOW); //C
|
||||||
digitalWrite(BCD_B, LOW); //B
|
digitalWrite(BCD_B, LOW); //B
|
||||||
digitalWrite(BCD_A, HIGH); //A
|
digitalWrite(BCD_A, HIGH); //A
|
||||||
digitalWrite(NX4A, 1); //Switch on Anode Nixie 4
|
digitalWrite(NX4A, 1); //Switch ON Anode Nixie 4
|
||||||
break;
|
break;
|
||||||
case 99:
|
default:
|
||||||
digitalWrite(BCD_D, HIGH); //D
|
digitalWrite(BCD_D, HIGH); //D
|
||||||
digitalWrite(BCD_C, HIGH); //C
|
digitalWrite(BCD_C, HIGH); //C
|
||||||
digitalWrite(BCD_B, HIGH); //B
|
digitalWrite(BCD_B, HIGH); //B
|
||||||
|
Loading…
x
Reference in New Issue
Block a user