main.cpp 1.46 KB
Newer Older
1
#include <avr/io.h>
2
#include <avr/interrupt.h>
3
#include <util/delay.h>
4
#include <stdint.h>
5

6
#include "SafeSolderingStation.h"
Martin Vítek's avatar
Martin Vítek committed
7
#include "Render.h"
Martin Vítek's avatar
Martin Vítek committed
8

Martin Vítek's avatar
Martin Vítek committed
9
//TODO: params in EEPROM
10

Martin Vítek's avatar
Martin Vítek committed
11
12
void find_character(uint8_t character);

13
14
int main()
{
15
    sss.init();
16
17
    //sss.wellcome();
    sss.render.wellcome_screen();
18

Martin Vítek's avatar
Martin Vítek committed
19
    /*
Martin Vítek's avatar
Martin Vítek committed
20
    sss.lcd.gotoxy_new(0,0);
21
    sss.lcd.write_text("3V4:     ");
Martin Vítek's avatar
Add ADC    
Martin Vítek committed
22
23

    sss.lcd.gotoxy_new(1,0);
24
    sss.lcd.write_text("24V:     V");
Martin Vítek's avatar
Martin Vítek committed
25
26
    */

Martin Vítek's avatar
Martin Vítek committed
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
    /*
    for (uint8_t i = 255; i > 0; i--)
    {
        sss.lcd.gotoxy_new(0,0);
        sss.lcd.write_num(i);

        sss.lcd.gotoxy_new(1,0);
        sss.lcd.write_char(i);

        _delay_ms(700);
    }
    */

    uint8_t character = 255;
    //find_character(character);

Martin Vítek's avatar
Martin Vítek committed
43

44
45
    for(;;)
    {
46
47
48
49
50
        //sss.render.rendering_handler();
        //sss.render.update_temperatures();
        //_delay_ms(500);

        sss.test_encoder();
51
    }
52
}
Martin Vítek's avatar
Martin Vítek committed
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71

void find_character(uint8_t character)
{
    for(;;)
    {
        if (sss.enc.event)
        {
            if (sss.enc.count >= 3)
            {
                character++;
                sss.enc.count = 0;
            }

            if (sss.enc.count<=-1)
            {
                character--;
                sss.enc.count = 0;
            }

72
73
            //sss.lcd.gotoxy_new(0,0);
            //sss.lcd.write_num(character);
Martin Vítek's avatar
Martin Vítek committed
74

75
76
            //sss.lcd.gotoxy_new(1,0);
            //sss.lcd.write_char(character);
Martin Vítek's avatar
Martin Vítek committed
77
78
79
80
81
82
83

            sss.enc.event = false;
        }

        _delay_ms(50);
    }
}