- Bluetooth hangszórók
- Fejhallgató erősítő és DAC topik
- Milyen alaplapot vegyek?
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Milyen egeret válasszak?
- Megjött a Razer DeathAdder egerek legfrissebb nemzedéke
- HiFi műszaki szemmel - sztereó hangrendszerek
- Apple MacBook
- RAM topik
- Home server / házi szerver építése
-
PROHARDVER!
Arduino hardverrel és szoftverrel foglakozó téma. Minden mikrovezérlő ami arduinoval programozható, és minden arduino program, board, és hardverrel kapcsolatos kérdések helye.
Új hozzászólás Aktív témák
-
KoVee84
senior tag
válasz
KoVee84 #19966 üzenetére
#include <Arduino.h>
#include "epd_driver.h"
#include "font/firasans.h"
#include "font/opensans72eb.h"
#include "esp_adc_cal.h"
#include "pins.h"
#include "time.h"
int vref = 1100;
const char* texts[] = {"Kovács","Könözsi","Csepura","Németh"};
const uint64_t egy_nap = 86400000000;
RTC_DATA_ATTR unsigned int reboot_counter = 0;
void setup()
{
Serial.begin(115200);
delay(10);
epd_init();
delay(10);
// Correct the ADC reference voltage
esp_adc_cal_characteristics_t adc_chars;
}
void loop()
{
switch (reboot_counter)
{
case 0:
{
epd_poweron();
epd_clear();
delay(10);
uint16_t v = analogRead(BATT_PIN);
float battery_voltage = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
String voltage = "Feszültség: " + String(battery_voltage) + "V";
Serial.println(voltage);
int cursor_x = 60;
int cursor_y = 475;
writeln((GFXfont *)&FiraSans, (char *)voltage.c_str(), &cursor_x, &cursor_y, NULL);
cursor_x = 180;
cursor_y = 290;
writeln((GFXfont *)&OpenSansExtraBold72, (texts[0]), &cursor_x, &cursor_y, NULL);
reboot_counter++;
epd_poweroff_all();
esp_sleep_enable_timer_wakeup(egy_nap * 7);
esp_deep_sleep_start();
}
case 1:
{
epd_poweron();
epd_clear();
delay(10);
uint16_t v = analogRead(BATT_PIN);
float battery_voltage = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
String voltage = "Feszültség: " + String(battery_voltage) + "V";
Serial.println(voltage);
int cursor_x = 60;
int cursor_y = 475;
writeln((GFXfont *)&FiraSans, (char *)voltage.c_str(), &cursor_x, &cursor_y, NULL);
cursor_x = 180;
cursor_y = 290;
writeln((GFXfont *)&OpenSansExtraBold72, (texts[1]), &cursor_x, &cursor_y, NULL);
reboot_counter++;
epd_poweroff_all();
esp_sleep_enable_timer_wakeup(egy_nap * 7);
esp_deep_sleep_start();
}
case 2:
{
epd_poweron();
epd_clear();
delay(10);
uint16_t v = analogRead(BATT_PIN);
float battery_voltage = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
String voltage = "Feszültség: " + String(battery_voltage) + "V";
Serial.println(voltage);
int cursor_x = 60;
int cursor_y = 475;
writeln((GFXfont *)&FiraSans, (char *)voltage.c_str(), &cursor_x, &cursor_y, NULL);
cursor_x = 180;
cursor_y = 290;
writeln((GFXfont *)&OpenSansExtraBold72, (texts[2]), &cursor_x, &cursor_y, NULL);
reboot_counter++;
epd_poweroff_all();
esp_sleep_enable_timer_wakeup(egy_nap * 7);
esp_deep_sleep_start();
}
case 3:
{
epd_poweron();
epd_clear();
delay(10);
uint16_t v = analogRead(BATT_PIN);
float battery_voltage = ((float)v / 4095.0) * 2.0 * 3.3 * (vref / 1000.0);
String voltage = "Feszültség: " + String(battery_voltage) + "V";
Serial.println(voltage);
int cursor_x = 60;
int cursor_y = 475;
writeln((GFXfont *)&FiraSans, (char *)voltage.c_str(), &cursor_x, &cursor_y, NULL);
cursor_x = 180;
cursor_y = 290;
writeln((GFXfont *)&OpenSansExtraBold72, (texts[3]), &cursor_x, &cursor_y, NULL);
reboot_counter++;
epd_poweroff_all();
esp_sleep_enable_timer_wakeup(egy_nap * 7);
esp_deep_sleep_start();
}
case 4:
{
epd_poweron();
delay(10);
int cursor_x = 550;
int cursor_y = 475;
writeln((GFXfont *)&FiraSans, ("SZELEKTÍV KUKA"), &cursor_x, &cursor_y, NULL);
reboot_counter++;
epd_poweroff_all();
esp_sleep_enable_timer_wakeup(egy_nap * 6);
esp_deep_sleep_start();
}
case 5:
{
esp_restart();
}
}
}
Új hozzászólás Aktív témák
- 4 év gari - magyar bill. - Lenovo ThinkPad Z13 G1 - AMD Ryzen R7 Pro 6850U, 13.3" 2.8K OGS érintő
- iKing.Hu - Xiaomi 14 Ultra - Ultra White - Használt, karcmentes
- Fedezd fel az NVIDIA világát! Kamatmentes rèszletre is!
- Crucial 240GB SSD eladó
- Bomba ár! HP ProBook 440 G7 - i5-10GEN I 8GB I 256SSD I HDMI I 14" FHD I Cam I W11 I Gar
Állásajánlatok
Cég: Promenade Publishing House Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest