Page 1 of 1

air mouse Accelerometer

Posted: Tue Dec 20, 2011 9:13 am
by misoct
Dear all
I am working on a project of air mouse accelerator using
1- Accelerometer board EB068-00-1
2- Two E-Blocks ZigBee endpoint and coordinator to send and receive accelerometer coordinates X and y
3- Base satiation with ECIO 40 connected to computer
4- Multiprogramming kit
Here I attached the flowcode files of the project where the project don’t work and the mouse cursor dos not move but by using two potentiometer instead of accelerometer board the project work well
If anyone have an experience how adjusting the configurations of zigbee with accelerometer I will be happy
thanks

Re: air mouse accelerator

Posted: Tue Dec 20, 2011 1:16 pm
by Benj
Hello Misoct,

Have you gotten anything out of the accelerometer module? Eg are you able to print the readings from the module to a LCD?

Re: air mouse accelerator

Posted: Tue Dec 20, 2011 2:25 pm
by misoct
Hello Benj
yes I tested the accelerometer by using the test file and I print on LCD xyz cordinates
thanks

Re: air mouse Accelerometer

Posted: Tue Dec 20, 2011 5:41 pm
by Benj
Great ok at least the sensor is working well. I will have a look at your program when I get 5 mins.

Re: air mouse Accelerometer

Posted: Thu Dec 22, 2011 1:10 pm
by misoct
Hi Bnje I forgeted to tell you that the sensor work well itself but there is a problem with Zigbee
thanks
tharowat

Re: air mouse Accelerometer

Posted: Thu Dec 22, 2011 11:12 pm
by Gary Freegard
Hi

Just been looking at your program, had a bit of trouble as I don’t have EB068-00-1or its components. But looking at the pdf the output from this sensor will be an integer (+-512) but you seem to be using a byte to hold the value and the Zigbee is using this byte.
So you will need to change the x and y variables from byte to integer and then split these into two and have two sends per axis.
Or the other option is to add 512 to each axis (still need to be integers) divide the answer by 4 and then storing the answer in a byte variable, this would mean that you would have to use just one send per axis. With this method an output off 0 will be -1g and 255 will be 1g and 127 will be zero.
Both of these options will require you to make changes to your receiver program.

I think that this is your problem , so hopefully it will point you in the right direction.

I have just completed a program to use an accelerometer, as an air mouse or joystick which you can find here http://www.matrixmultimedia.com/mmforum ... =29&t=9965

regards

Gary

Re: air mouse Accelerometer

Posted: Sun Dec 25, 2011 4:05 pm
by misoct
Hi gary
Thank you for your valuable tips that helped me a lot to run the program well, and there are some problems I will work to resolve them
I would like to know Is it possible to usehttp://www.parallax.com/Portals/0/Downl ... l-v1.1.pdfusing your program, which modification on the program achieve that
Again I thank you
And happy Christmas

Re: air mouse Accelerometer

Posted: Mon Dec 26, 2011 12:57 pm
by Gary Freegard
Hi
Looking at the manufactures datasheet http://www.parallax.com/Portals/0/Downl ... tation.pdf , there are a few of differences.
  • You have a choice of either one byte or two bytes (10bits of data) per channel and these come from different registers. $06,$07,$08 for 8bits and $01 to $06 for 10bits.
    And for setup and start measuring only one registers needs to be written to, $16
    Plus the device address is different ($1D).
    When the device has finished measurement then the DRDY pin goes high.
So you will need to change my program to only start reading when the DRDY goes high, plus the other changes above.

Gary