Thanks alot.
I inserted the below code to test, however not having much luck. It gave me warnings that "OUTPUT" was not declared. I researched and inserted #include "WProgram.h" which solved the problem.
The serial monitor doesn't look like its printing the remaining fuel value. (its some number with 8-9 digits). Its likely because i have the code in the wrong spot. I cant really trial different locations because it takes >15mins to compile. The PWM output generator works at least when I assign it a constant.
Where should I locate this code? Could you please advise what line it should go after?
Thanks again for the assistance.
pinMode(11, OUTPUT);
unsigned long fuela = SWEET64(prgmFindRemainingFuel, tankIdx);
int fuelout = (fuela/60000)*255;
TCCR2A = _BV(COM2A1) | _BV(COM2B1) | _BV(WGM21) | _BV(WGM20);
OCR2A = fuelout;
Serial.begin(9600);
Serial.println(fuela);
|