From a6d6ddef708bd8d085e2b66aceda37e0895abf88 Mon Sep 17 00:00:00 2001 From: Dobrica Pavlinusic Date: Tue, 1 Nov 2016 14:51:27 +0100 Subject: [PATCH] generate serial output for trend --- Makefile | 3 +++ main.c | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 8fe8272..71b5d27 100644 --- a/Makefile +++ b/Makefile @@ -11,3 +11,6 @@ flash: main.hex serial: microcom -p $(SERIAL) -s 9600 + +trend: + microcom -p $(SERIAL) -s 9600 | trend -geometry 800x200 -v -c1a -c2a -L V,A - 600x1 diff --git a/main.c b/main.c index fc797a6..b79f191 100644 --- a/main.c +++ b/main.c @@ -7,7 +7,7 @@ #define UBRR_VALUE (((F_CPU/(USART_BAUDRATE*16UL)))-1) // this will output only changes on serial -#define SERIAL_CHANGES 1 +#define SERIAL_CHANGES 0 void serial_init(){ // initialize USART (must call this before using it) @@ -30,7 +30,7 @@ void serial_string(const char* s){ void serial_break(){ serial_send(10); // new line - serial_send(13); // carriage return +// serial_send(13); // carriage return } void serial_comma(){ serial_send(','); // comma @@ -86,8 +86,8 @@ volatile uint8_t regC; volatile uint8_t regD; // these values will hold the current/voltage value -volatile char current[4]; -volatile char voltage[4]; +volatile char current[4] = "XXXX"; +volatile char voltage[4] = "XXXX"; volatile int display_sum = 0; volatile int last_display_sum = 0; @@ -208,7 +208,7 @@ void capture_full(){ serial_send(voltage[i]); if (i==1){serial_send('.');} } - serial_send(','); + serial_send(' '); for(i=0;i<4;i++) { serial_send(current[i]); if (i==2){serial_send('.');} -- 2.20.1