Veketti
Full Member level 3
Hello Milan,
Thanks for your help. I was wondering what's the idea of CopyStr function as it's never called? Interesting to see how this can be made more shorter, but it seems to still not show anything on display. Let me describe what I planned it to do. Read from acceleration sensor X-axis and Z-axis their voltage level which corresponds to acceleration. Calculate it to show g-value eg. 1.66V is 0g and sensitivity is 333mV/g. As the readout from A/D is something like 339.97 which should represent 0.00g on display. Value can be also negative between -3g to +3g and result should be shown on display with 2 digit accuracy. Currently program updates only one axis per cycle. Also on that cycle corresponding highest acceleration value is stored on variable and shown after the actual acceleration. Both axis should have the max acceleration displayed after the actual reading. Like this:
actual max
X=1.25g 2.10
Z=-0.52g 0.45
FVM, Yes, this has evolved quite much, sorry for that. In the beginning I had mcu which ran out of memory and was having problems on using floats so thought to ask help how to overcome without using floats. Changed the mcu to one that has more memory and hoped that would solve the issue. It's not clear to me why this is failing as it's not massive calculations and PIC16F1847 show still much free memory.
Thanks for your help. I was wondering what's the idea of CopyStr function as it's never called? Interesting to see how this can be made more shorter, but it seems to still not show anything on display. Let me describe what I planned it to do. Read from acceleration sensor X-axis and Z-axis their voltage level which corresponds to acceleration. Calculate it to show g-value eg. 1.66V is 0g and sensitivity is 333mV/g. As the readout from A/D is something like 339.97 which should represent 0.00g on display. Value can be also negative between -3g to +3g and result should be shown on display with 2 digit accuracy. Currently program updates only one axis per cycle. Also on that cycle corresponding highest acceleration value is stored on variable and shown after the actual acceleration. Both axis should have the max acceleration displayed after the actual reading. Like this:
actual max
X=1.25g 2.10
Z=-0.52g 0.45
FVM, Yes, this has evolved quite much, sorry for that. In the beginning I had mcu which ran out of memory and was having problems on using floats so thought to ask help how to overcome without using floats. Changed the mcu to one that has more memory and hoped that would solve the issue. It's not clear to me why this is failing as it's not massive calculations and PIC16F1847 show still much free memory.