air mouse Accelerometer

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 4.
To post in this forum you must have a registered copy of Flowcode 4 or higher. To sign up for this forum topic please use the "Online Resources" link in the Flowcode Help Menu.

Moderator: Benj

Post Reply
User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

air mouse Accelerometer

Post 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
Attachments
end.deviceaccl.fcf
(9.5 KiB) Downloaded 266 times
USB_mouse(xy)16-12.fcf
(12.5 KiB) Downloaded 264 times
Last edited by misoct on Tue Dec 20, 2011 2:37 pm, edited 1 time in total.

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: air mouse accelerator

Post 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?

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: air mouse accelerator

Post by misoct »

Hello Benj
yes I tested the accelerometer by using the test file and I print on LCD xyz cordinates
thanks
Attachments
AccelTest.fcf
(7.5 KiB) Downloaded 265 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: air mouse Accelerometer

Post by Benj »

Great ok at least the sensor is working well. I will have a look at your program when I get 5 mins.

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: air mouse Accelerometer

Post by misoct »

Hi Bnje I forgeted to tell you that the sensor work well itself but there is a problem with Zigbee
thanks
tharowat

Gary Freegard
Posts: 45
Joined: Mon Nov 07, 2011 6:36 pm
Has thanked: 1 time
Been thanked: 30 times
Contact:

Re: air mouse Accelerometer

Post 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

User avatar
misoct
Posts: 64
Joined: Sat Sep 04, 2010 11:03 pm
Location: Egypt
Has thanked: 8 times
Been thanked: 17 times
Contact:

Re: air mouse Accelerometer

Post 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

Gary Freegard
Posts: 45
Joined: Mon Nov 07, 2011 6:36 pm
Has thanked: 1 time
Been thanked: 30 times
Contact:

Re: air mouse Accelerometer

Post 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

Post Reply