Blame |
Last modification |
View Log
| RSS feed
#include <avr/io.h>
#include <inttypes.h>
#include <stdlib.h>
#include <avr/pgmspace.h>
#include "main.h"
#include "base64.h"
#include "lcd.h"
#include "rs232.h"
// Insgesamt 32 Werte können angezeigt werden
// jeweils 8 Stück werden gleichzeitg angezeigt
// Auswahl über Tasten
uint8_t displ_page
;
void displ_get_text
(uint8_t number
)
{
uint8_t text
[17];
uint8_t i
;
p_buffer
[0] = '#';
p_buffer
[1] = 'a';
p_buffer
[2] = 'a';
p_buffer
[3] = number
;
p_buffer
[4] = 0;
p_buffer
[5] = 0;
base64_send
(6);
do
{
get_message
();
}
while (r_buffer
[1] != 'A');
for (i
=0;i
<16;i
++)
text
[i
] = p_buffer
[i
];
text
[16] = 0x00;
lcd_print_at
(0,(number
& 0x07),text
,0);
}
void displ_values
(void)
{
uint8_t displ_page
, i
;
int16_t value
;
uint8_t text
[17];
displ_page
= 0; // Page 0..3 (4 Pages zu je 8 Werte)
lcd_cls
(); // LCD löschen
do
{
for (i
=0;i
<8;i
++) // Texte lesen und anzeigen
displ_get_text
(i
+displ_page
*8);
do
{
get_message
();
if(r_buffer
[1] == 'D')
{
for (i
=0;i
<8;i
++)
{
value
= p_buffer
[i
*2+displ_page
*16+2] + 256*p_buffer
[i
*2+displ_page
*16+3];
itoa(value
,text
,10);
lcd_print_atp
(14,i
,PSTR
(" "),0);
lcd_print_at
(14,i
,text
,0);
}
}
}
while (key
== 0x00);
if (key
== 0x01)
displ_page
++;
if (key
== 0x02)
displ_page
--;
displ_page
&= 0x03;
}
while(key
!= 0x08);
}