projects
/
Arduino-Nano-VA-meter
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
1b0ddf7
)
generate serial output for trend
master
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 1 Nov 2016 13:51:27 +0000
(14:51 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Tue, 1 Nov 2016 13:51:27 +0000
(14:51 +0100)
Makefile
patch
|
blob
|
history
main.c
patch
|
blob
|
history
diff --git
a/Makefile
b/Makefile
index
8fe8272
..
71b5d27
100644
(file)
--- a/
Makefile
+++ b/
Makefile
@@
-11,3
+11,6
@@
flash: main.hex
serial:
microcom -p $(SERIAL) -s 9600
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
(file)
--- 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 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)
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
void serial_break(){
serial_send(10); // new line
-
serial_send(13); // carriage return
+
//
serial_send(13); // carriage return
}
void serial_comma(){
serial_send(','); // comma
}
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 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;
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(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('.');}
for(i=0;i<4;i++) {
serial_send(current[i]);
if (i==2){serial_send('.');}