adventsfenster/src/main.cpp
2021-11-08 13:18:06 +01:00

102 lines
1.8 KiB
C++

#include "main.h"
//funtion prototypes
void show_counters(uint64_t counter_licht, uint64_t counter_move);
//variables
uint64_t licht_all_count = 0;
uint64_t move_all_count = 0;
void setup() {
Serial.begin(115200);
//load counters
// save.set_int("licht", 0);
// save.set_int("move", 0);
// licht_all_count = save.get_int("licht");
// move_all_count = save.get_int("move");
// all relais off;
relais_haeuser.off();
relais_sterne.off();
relais_spiegel.off();
relais_other.off();
/*
zugoben.stop();
zugunten.stop();
led_tanne.setColor(0x0f0);
mp3ply.play(1);
*/
}
uint8_t licht_count = 0;
void loop() {
//led_teich.rainbowCycle();
//rgb_leds.show();
if(taster_aussen_licht.pressed())
relais_haeuser.toggle();
if(taster_aussen_move.pressed())
relais_other.toggle();
if(taster_train_oben.pressed())
relais_sterne.toggle();
if(taster_train_unten.pressed())
relais_spiegel.toggle();
/*
show_counters(licht_all_count, move_all_count);
switch (licht_count)
{
case 1:
haeuser.on();
sterne.off();
spiegel.off();
other.off();
break;
case 2:
haeuser.off();
sterne.on();
spiegel.off();
other.off();
break;
case 3:
haeuser.off();
sterne.off();
spiegel.on();
other.off();
break;
case 4:
haeuser.off();
sterne.off();
spiegel.off();
other.on();
break;
default:
haeuser.off();
sterne.off();
spiegel.off();
other.off();
break;
}
*/
}
/*
void show_counters(uint64_t counter_licht, uint64_t counter_move)
{
moni.clear();
moni.header("Zaehler");
moni.data(10,15,counter_licht, "Licht:");
moni.data(10,15,counter_move, "Moves:");
moni.show();
}
*/