ok I have done some more changes... just for debugging purposes... My code now looks like:
This was to test if putting the variable rtotal after the DIV32 command was in any way incorrect. According to what I understand, it should now just display a fixed 1071rpm on the LCD.Code:PULSIN PORTD.6,1,rlow PULSIN PORTD.6,0,rhigh rtotal = (rlow + rhigh) / 10 tbase = 500 * 600 rpm = div32 280 if rpm = 65535 then rpm = 0 endif
However... when I now start the engine, at any rpm lower than roughly 1100 (probably 1071 to be precise), the display shows 0rpm, but over that, as I rev the engine, it shows RPM in the 32000 + range.
WHAT IS DIV32 DIVIDING BY 280??? Cause it's not 300000...
Bookmarks