i am gathering data from Razor IMU with ADXL345. when i connect the micro controller, it is in communication port and in putty i have to select the baudrate of 57600. then a message comes as followed:
=~=~=~=~=~=~=~=~=~=~=~= PuTTY log 2013.01.04 04:24:02 =~=~=~=~=~=~=~=~=~=~=~=9DOF IMU Firmware v22 ==========================[1]Accelerometer: ADXL345 [2]Magnetometer: HMC5883 [3]Gyroscope: ITG-3200 [4]Raw Output[5]Change Baud Rate: 57600bps[Ctrl+z]Toggle Autorun[?]Help
in this case i have to press "1" and the data of accelerometer comes as followed:
x= 5, y= 41, z= 230 x= 5, y= 41, z= 231 x= 5, y= 41, z= 230 x= 5, y= 39, z= 230 x= 6, y= 42, z= 231 x= 7, y= 41, z= 230 x= 7, y= 41, z= 230 x= 4, y= 41, z= 231 x= 6, y= 41, z= 232 x= 6, y= 41, z= 231 x= 5, y= 41, z= 229 x= 6, y= 41, z= 231 x= 6, y= 41, z= 229 x= 6, y= 40, z= 229 x= 5, y= 42, z= 230 x= 6, y= 43, z= 230
……………..
i wrote the code in matlab as followed but it isn't working…
s1 = serial('COM4'); %define serial port
s1.BaudRate=57600fopen(s1)display (s1)
all i want to do to have a variable to assign the array and after that i want to manipulate as i require in real time.
Best Answer