View Single Post
Old 06-27-2008, 01:38 PM   #20 (permalink)
Magister
OBDuino coder
 
Magister's Avatar
 
Join Date: Jun 2008
Location: Montréal, QC
Posts: 212

Titine - '13 Hyundai Sonata Hybrid
Thanks: 3
Thanked 10 Times in 8 Posts
Thanks Bluecivic!

hé, we're not that far, I go through Albany when I go in vacation

I continued my code to write a function to send an ISO string, a command is 7 bytes length maximum IIRC. The same function will return the response and the number of received bytes.

I plan to have four pointers to function to display the four info in the four corners, prototype something like
void (*topleft)(void);
void (*topright)(void);
void (*bottomleft)(void);
void (*bottomright)(void);

then in the config it will assign what you want, e.g. if you want to have the instant MPG in the top left, the config will assign the pointer of the function to the topleft() one. Let's assume a function cal_inst_mpg() calculate it, the config will just do:

topleft=cal_inst_mpg;

and in the loop() it will do:

loop()
{
// read a couple of value
iso_read_whatever

// display on LCD
lcd.gotoXY(0,0);
topleft();
lcd.gotoXY(8,0);
topright();
lcd.gotoXY(0,1);
bottomleft();
lcd.gotoXY(8,1);
bottomright();
}

but hé, I go too far, let's receive the board and solder it before!
__________________
2013 Hyundai Sonata Hybrid
  Reply With Quote