11
// the width of the display of a single channel (in chars)
21
static void draw_graph( int channel_values[] )
24
static char graph[ GRAPH_SIZE + 2 ];
25
static char inited_graph = false;
27
for( int a = 1; a < GRAPH_SIZE + 1; a++ )
30
graph[ GRAPH_SIZE + 1 ] = 0;
35
for( int a = 0; a < NUM_CHANNELS; a++ ) {
36
unsigned long value = min( channel_values[ a ], MAX_CHANNEL_VALUE );
37
int pos = ( GRAPH_SIZE ) * value / MAX_CHANNEL_VALUE;
38
graph[ pos + 1 ] = '^';
39
Serial.print( graph );
40
graph[ pos + 1 ] = '_';
42
Serial.println( "|" );
46
static void write_raw_channel_data( int channel_values[] )
50
unsigned char *data = reinterpret_cast< unsigned char * >( channel_values );
51
Serial.write( data, sizeof( channel_values ) * NUM_CHANNELS );
55
void Comms::write_channels( int channel_values[] )
57
// draw_graph( channel_values );
58
write_raw_channel_data( channel_values );