Quote:Great project, very interesting stuff !Â
Agree, too complex to use only cmos, better choice with µC.Â
Â
Btw I use loop delay to read buttons without rebound on AVR - reading occurs every 100ms, enough to get a correct reading.
This also allow to distinguish between short / long keypresses.
Not using interrupts anymore for that purpose, better use them for non-human events.
Â
Any chance to get pics and other info on your project ?
Â
It's just for fun JBX, basic details so far...
Accelerometer unit -MPU6050 (cheap Chinese PCB mounted.)
The micro, for development is a PIC18F25k22, i use an LCD there to give me raw data values for evaluation), final project will be implemented on a pic 16F1824 (14 pins), which has 4 PWM outputs, I2C for the MPU6050, and the LED's will be low side switched by _any_generic_NPN_transistor_Â of a suitable power rating.
Â
I program a mixture of assembly language for time critical functions and interrupts, nested within PicBasicPro. I use Basic for structural outlines and because it already has I2C control instructions built in , so no need for 'bit banging' any more, thankfully ! I used to use C for structure but just because i got a free PicBasicPro compiler I use that mostly instead. (If you can use C then it's great for Microchip piuc micro's, they have vast libraries, all in C, free to download)
Â
So far I've run a test rig with LCD display on the tank to check all 6 axis outputs from the MPU6050. I was really surprised by the x-gyro, it can be used as a trigger to detect the rolling over of the bike when changing direction quickly. The x- accelerometer gives a good steady linear accel/decel output.. Not much money for such a lot of motion detection.
Â
Then i transferred the code to an 8 pin micro 12F1840 to see if I could modulate the PWM outputs to show that when braking hard the DRL's could (as an example) be flickered more obviously, to give the vehicle you're about to crash into a heads up ! (bad taste joke....), or just as easily warn a pedestrian who stepped onto the road, when you see them before they see you.....(maybe a loud exhaust is enough here though !)
Â
So now the 16F1824's arrived this morning, I'm too tired to to do something with it tonight but I hope to connect it all together in the next week or two.
<p style="text-align:center;">Ohlins, PC3, fuel cut defeat, +4deg timing, 17" front wheel.

