Commit 15dc90b7 authored by Martin Vítek's avatar Martin Vítek
Browse files

Add base of rendering

parent a11e0b3d
......@@ -115,6 +115,8 @@ class ADC
void convert_adc_values()
{
results[SUPPLY_VOLTAGE] = 244UL * (uint32_t)adc_results[SUPPLY_VOLTAGE] * 28UL / 1079UL / 10UL;
//results[SUPPLY_VOLTAGE] = 244UL * (uint32_t)adc_results[SUPPLY_VOLTAGE] * 28UL / 1079UL / 10UL;
results[SUPPLY_VOLTAGE] = 244UL * (uint32_t)(adc_results[SUPPLY_VOLTAGE]-200) * 28UL / 10000UL;
}
};
......@@ -47,6 +47,8 @@ set(SOURCE_FILES
Uart.h
Backlight.h
ADC.h
Render.cpp
Render.h
)
add_avr_executable(safe-soldering-station ${SOURCE_FILES})
#include "Render.h"
#pragma once
#define MAX_LENGHT 15
#define ARROW_UP 0x1E
#define ARROW_DOWN 0x1F
//MAX "xxxxxxxxxxxxxxx"
struct menu
{
};
struct status_screen
{
const char* supply_voltage = "Uss: V";
const char* vcc_voltage = "Ucc: V";
};
class Render
{
public:
Render();
};
......@@ -4,6 +4,7 @@
#include <stdint.h>
#include "SafeSolderingStation.h"
#include "Render.h"
int main()
......@@ -11,17 +12,30 @@ int main()
sss.init();
sss.wellcome();
/*
sss.lcd.gotoxy_new(0,0);
sss.lcd.write_text("3V4: ");
sss.lcd.gotoxy_new(1,0);
sss.lcd.write_text("24V: V");
*/
status_screen status;
sss.lcd.gotoxy_new(0,0);
sss.lcd.write_text(status.supply_voltage);
sss.lcd.write_char(ARROW_UP);
sss.lcd.gotoxy_new(1,0);
sss.lcd.write_text(status.supply_voltage);
sss.lcd.write_char(ARROW_DOWN);
for(;;)
{
//sss.test_encoder();
//sss.test_backlight();
sss.test_adc();
_delay_ms(50);
_delay_ms(100);
}
}
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment