Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
730 | woggle | 1 | |
2 | #include <avr/io.h> |
||
3 | #include <inttypes.h> |
||
4 | #include <stdlib.h> |
||
5 | #include <avr/pgmspace.h> |
||
6 | |||
7 | #include "main.h" |
||
8 | #include "lcd.h" |
||
9 | #include "usart.h" |
||
10 | |||
11 | // Insgesamt 32 Werte können angezeigt werden |
||
12 | // jeweils 8 Stück werden gleichzeitg angezeigt |
||
13 | // Auswahl über Tasten |
||
14 | |||
15 | uint8_t displ_page; |
||
16 | |||
17 | |||
18 | void displ_get_text (uint8_t number) |
||
19 | { |
||
20 | #if 0 |
||
21 | uint8_t text[17]; |
||
22 | uint8_t i; |
||
23 | |||
24 | buffer[0] = '#'; |
||
25 | buffer[1] = 'a'; |
||
26 | buffer[2] = 'a'; |
||
27 | buffer[3] = number; |
||
28 | buffer[4] = 0; |
||
29 | buffer[5] = 0; |
||
30 | // base64_send(6); |
||
31 | |||
32 | do |
||
33 | { |
||
34 | // get_message (); |
||
35 | } |
||
36 | while (buffer[1] != 'A'); |
||
37 | |||
38 | for (i = 0; i < 16; i++) |
||
39 | text[i] = buffer[i]; |
||
40 | |||
41 | text[16] = 0x00; |
||
42 | |||
43 | lcd_print_at (0, (number & 0x07), text, 0); |
||
44 | #endif |
||
45 | } |
||
46 | |||
47 | void displ_values (void) |
||
48 | { |
||
49 | #if 0 |
||
50 | uint8_t displ_page, i; |
||
51 | int16_t value; |
||
52 | uint8_t text[17]; |
||
53 | |||
54 | displ_page = 0; // Page 0..3 (4 Pages zu je 8 Werte) |
||
55 | lcd_cls (); // LCD löschen |
||
56 | |||
57 | do |
||
58 | { |
||
59 | for (i = 0; i < 8; i++) // Texte lesen und anzeigen |
||
60 | displ_get_text (i + displ_page * 8); |
||
61 | |||
62 | do |
||
63 | { |
||
64 | // get_message (); |
||
65 | if (buffer[1] == 'D') |
||
66 | { |
||
67 | for (i = 0; i < 8; i++) |
||
68 | { |
||
69 | value = buffer[i * 2 + displ_page * 16 + 2] + 256 * buffer[i * 2 + displ_page * 16 + 3]; |
||
70 | itoa (value, text, 10); |
||
71 | lcd_printp_at (14, i, PSTR(" "), 0); |
||
72 | lcd_print_at (14, i, text, 0); |
||
73 | } |
||
74 | } |
||
75 | } |
||
76 | while (key == key_nokey); |
||
77 | if (key == key_minus) |
||
78 | displ_page++; |
||
79 | |||
80 | if (key == key_plus) |
||
81 | displ_page--; |
||
82 | |||
83 | displ_page &= 0x03; |
||
84 | } |
||
85 | while (key != key_enter); |
||
86 | #endif |
||
87 | } |
||
88 |