wannaBinventor
Member
I was able to get my LGA-14 accelerometers from Freescale up and running on a board I made. I have verified that it's good with a multimeter on the analog outputs. Now, of course, I need to get this going with my PIC to display the G force on an LCD. Eventually I'd like to do some trig functions to show angle of lean and what not.
For now I just want to show the g force on each axis on an LCD. I'm using PIC ASM on a a PIC16F1934 and I don't want a ridiculously long lookup table for the 255 measurements of the 8 bit LCD. I've done math to convert binary readings to decimal. That's not a problem. What is a problem is the fact that I need to do this math:
G force = (volts read - 1.4 volts) / 0.0836
G force = (8 bit ADC reading - 174) / 0.0836
FYI, 174 is roughly the value of the 8 bit ADC at 0 g (1.4 volts) on a 2.048 fixed voltage reference.
I only really need the accuracy to 1 or 2 decimal places.
I have no idea where to begin doing that in PIC ASM.
I tried DLing something from PIClist, but the file won't unzip.
Thanks!
For now I just want to show the g force on each axis on an LCD. I'm using PIC ASM on a a PIC16F1934 and I don't want a ridiculously long lookup table for the 255 measurements of the 8 bit LCD. I've done math to convert binary readings to decimal. That's not a problem. What is a problem is the fact that I need to do this math:
G force = (volts read - 1.4 volts) / 0.0836
G force = (8 bit ADC reading - 174) / 0.0836
FYI, 174 is roughly the value of the 8 bit ADC at 0 g (1.4 volts) on a 2.048 fixed voltage reference.
I only really need the accuracy to 1 or 2 decimal places.
I have no idea where to begin doing that in PIC ASM.
I tried DLing something from PIClist, but the file won't unzip.
Thanks!
Last edited: