-
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
- Xiaomi Redmi Note 14 Pro Plus 12/512GB Újszerű,Dobozos,Kétkártyás 1év Garanciával!
- Prémium MAGYAR PBT custom keycap készlet eladó - Goblintechkeys
- DJI Air 2s Fly More Combo drón szett megkímélt állapotban, kofferrel
- ASUS ROG Strix G17 17.3" Notebook! i7-10750H / RTX 2070 Super / 1TB NVMe / 16GB DDR4! BeszámítOK
- Void RGB PC - i7 9700f, 16Gb RAM, RTX 2080Ti 11Gb stb.
- Bomba ár! Dell Latitude 7420 - i7-1185G7 I 16GB I 512SSD I HDMI I 14" 4K I Cam I W11 I Garancia!
- Bomba ár! Lenovo ThinkPad T490 - i5-8GEN I 16GB I 256GB SSD I 14" FHD I Cam I W10 I Garancia!
- LG 45GS95QE - 45" Ívelt OLED / 2K WQHD / 240Hz 0.03ms / NVIDIA G-Sync / FreeSync Premium / HDMI 2.1
- 3DKRAFT.HU - 3D NYOMTATÁS - AZONNALI ÁRAJÁNLAT - GYORS KIVITELEZÉS - 480+ POZITÍV ÉRTÉKELÉS
- Lenovo Legion 5 Gaming. Az ár irányár, komoly érdeklődés esetén van lehetőség egyeztetésre
Állásajánlatok
Cég: PC Trade Systems Kft.
Város: Szeged
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest