Hirdetés
- Fotók, videók mobillal
- Samsung Galaxy Watch4 és Watch4 Classic - próbawearzió
- Xiaomi 15T Pro - a téma nincs lezárva
- Mobil flották
- Samsung Galaxy S24 Ultra - ha működik, ne változtass!
- Vége a dalnak: leállt az iPhone Air gyártása
- Apple Watch
- Miért fárad gyorsabban az iPhone akku, mint az androidos?
- Örömhír: nem spórol Európán a OnePlus
- Xiaomi 15 - kicsi telefon nagy energiával
-
Mobilarena
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
- Mini PC
- Fotók, videók mobillal
- Torrent meghívó kunyeráló
- PayPal
- sziku69: Fűzzük össze a szavakat :)
- AMD Ryzen 9 / 7 / 5 7***(X) "Zen 4" (AM5)
- Samsung Galaxy Watch4 és Watch4 Classic - próbawearzió
- AMD K6-III, és minden ami RETRO - Oldschool tuning
- Mibe tegyem a megtakarításaimat?
- LEGO klub
- További aktív témák...
- Pioneer VSX-922
- Eladó: 2 db MSI MAG272CQR 27' Ívelt Gaming Monitor (csak egyben)
- Gamer PC-Számítógép. Csere-Beszámítás! R7 5800X / RTX 5060 / 32GB DDR4 / 1TB SSD
- LG UltraGear OLED 27GX790A-B . 480Hz . 0.03ms . 2560x1440 - Garancia 2028.07.07.
- ÚJszerű 1Hónapos Apple iPhone 17 256GB Black 1OO% ! még 11 Hó nemzetközi APPLE GaranciÁval
- Eladó egy oneplus 9 pro 256/12
- HP ZBook Power 15 G8 Mobile Workstation i7-11850H 32GB 512GB Nvidia RTX A2000
- Keresek Xbox Series S / Series X / Playstation 5 konzolokat
- AKCIÓ! Lenovo Legion Slim 5 Gamer notebook - R7 7435HS 16GB RAM 1TB SSD RTX 4070 8GB GDDR6 WIN11
- 137 - Lenovo Legion Pro 7 (16IRX9H) - Intel Core i9-14900HX, RTX 4080 - 4 ÉV GARANCIA!
Állásajánlatok
Cég: Laptopműhely Bt.
Város: Budapest
Cég: NetGo.hu Kft.
Város: Gödöllő
ekkold

