Storing Negative Numbers
chaching001
Posts: 2
Hi-
I'm working with the 3D accelerometer 7455, and having issues storing the negative values. I used the online template program MMA7455L 3-Axis Accelerometer Demo (PBasic) v1.0 DEMO#1.bs2 to start, and have edited the code around so that I can store the values, and then when prompted to display them. I'm aware of the SDEC command, and have implemented it in the DEBUG command when I want to display them. But I think my issue is in the WRITE command. I'm sending the acceleration values into a write command to store, but I don't know if the negative's are correctly storing, because when I later extract them and DEBUG them, all my numbers are positive, and I'm pretty sure the values that are supposed to be -1, -2, ... etc are 255, 254...
I'm working with the 3D accelerometer 7455, and having issues storing the negative values. I used the online template program MMA7455L 3-Axis Accelerometer Demo (PBasic) v1.0 DEMO#1.bs2 to start, and have edited the code around so that I can store the values, and then when prompted to display them. I'm aware of the SDEC command, and have implemented it in the DEBUG command when I want to display them. But I think my issue is in the WRITE command. I'm sending the acceleration values into a write command to store, but I don't know if the negative's are correctly storing, because when I later extract them and DEBUG them, all my numbers are positive, and I'm pretty sure the values that are supposed to be -1, -2, ... etc are 255, 254...
Comments
Thanks again. It really means a lot!
Ben