yay, the words straight math worked great in my mind!
i found the easy way to solve the gear indicator problem
now i count the pulses of the tach and the rear wheel over a 500 millisecond time, then i multiply * 100 the wheel pulses and divide it by the tach pulses. this way i can work only with integers avoiding float values. the sketch runs around 1300 loops per second, but if I enable all the analog sensors readings it slow down to 780...
great work on the math - that's the kind of thing you need to do.
I found it better to track the time for a set number of pulses rather than the number of pulses in a given time - at 10 kph your wheels are only turning a few times a second. I guess you've got a bunch of interrupts per turn of the front wheel but even so...
if i disable interrupts while i do calculation, don't i risk to miss pulses?
i made all the code in the loop function, except the interrupts, if I use many separate functions instead a big one, is the program quicker? are the external functions (outside the loop) ran simoultaneously? thanks a lot!
You only need to disable the interrupts for a microsecond while you copy the variable that the interrupt routine updates to one in your Loop procedure - you won't miss any interrupts since the ISR will run when you reenable them.
Do post your code - I'm going to go look at your pics now.