Hirdetés
- Autós kamerák
- MILC felhasználók szakmai topikja
- ThinkPad (NEM IdeaPad)
- Apple MacBook
- NVIDIA GeForce RTX 5080 / 5090 (GB203 / 202)
- Nagyon bízik az Instinct MI450-ben az AMD alelnöke
- Hobby elektronika
- Hogy is néznek ki a gépeink?
- Melyik tápegységet vegyem?
- NVIDIA GeForce RTX 5070 / 5070 Ti (GB205 / 203)
-
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
- iKing.Hu - Nothing Phone (2a) Black Fiatalos Glyph stílus, 120 Hz AMOLED 8/128 GB Gari
- AKCIÓ! Lenovo Legion Slim 5 Gamer notebook - R7 7435HS 16GB RAM 1TB SSD RTX 4070 8GB GDDR6 WIN11
- DELL PowerEdge R630 rack szerver - 2xE5-2680v4 (28c/ 56t, 2.4/3.3GHz), 128GB RAM, 10G, áfás szla
- Lenovo ThinkCentre M720q/ Dell OptiPlex 3070/ Hp EliteDesk 800 G4-G5 mini, micro PC-Számla/garancia
- GYÖNYÖRŰ iPhone XS Max 64GB Gold -1 ÉV GARANCIA - Kártyafüggetlen, MS3298
Állásajánlatok
Cég: CAMERA-PRO Hungary Kft.
Város: Budapest
Cég: PCMENTOR SZERVIZ KFT.
Város: Budapest