Hirdetés
- 5G-s ZTE tábla érkezett a lengyel piacra
- Projektor topic
- Gaming notebook topik
- Pánik a memóriapiacon
- Hővezető paszták
- Elkészült az SMIC 5 nm-es node-ja, de a kínaiaknak haszna nincs rajta
- AMD Navi Radeon™ RX 9xxx sorozat
- VR topik
- Lenovo Legion Go: a legsokoldalúbb kézikonzol
- Durván kitömte memóriával két új Radeonját az AMD
-
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
- Canon EF 28-300mm f/3.5-5.6L IS USM - Újszerű -
- ÚJ MacBook Pro 14" M4 PRO 24GB 512GB Space Black
- Microsoft Surface Laptop 3 13.5" fekete i5-1035G7 16GB 512GB 1 év garancia
- GAMER INTEL I5 8500/16GB DDR4/GTX 1660Ti/256GB NVME SSD/500GB HDD
- Eladó újszerű Trust Mantis GXT232 streaming mikrofon dobozában
- KÉSZLETKISÖPRÉSI ULTRA GIGA AKCIÓ! CTO 0perces SKY MacBook Air 15" M4 10C/10G 16GB 1000GB 1 év gar
- Telefon felvásárlás!! Samsung Galaxy S25, Samsung Galaxy S25 Plus, Samsung Galaxy S25 Ultra
- Shining3D EinScan Pro 2X 3D szkenner
- LicencAruhaz.hu OLCSÓ, LEGÁLIS SZOFTVEREK AZONNAL - Windows - Office - Win Server - ÖRÖK GARANCIÁVAL
- Keresünk Galaxy S23/S23+/S23 Ultra/S23 Fe
Állásajánlatok
Cég: BroadBit Hungary Kft.
Város: Budakeszi
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest
ekkold

