
Educators: Earn a free Gold upgrade by joining the PBwiki Back To School Challenge.
The WiTilt is a three-axis wireless accelerometer module sold by Sparkfun.
Useful information from the Sparkfun website:
Other useful info:
We've started to run endurance tests (using Leith's WiTiltBatteryTestScript) with a WiTilt v2.5 powered by one of SparkFun's 850mAh Lithium-polymer batteries. While the battery hasn't run out yet (theoretically you can expect up to 850mAh/40ma ~=21 hours of operation), the Bluetooth link has been dropping out. Recent measurements of link uptime:
After this time, the link LED on WiTilt goes off, and in Python the serial port now looks "closed." We can reestablish the Bluetooth link by re-opening the serial port (e.g., ser.open() in Python). This is because we have a "Quick Connect" entry in IVT BlueSoleil that starts the connection whenever the associated COM port is opened. So graceful recovery seems possible.
On mac os X endurance tests the connection has lasted upwards of 3 hours, but exemplar became very slow as the time went on. This test was just done by leaving exemplar open with the WiTilt connected
Q: We need to check what state the WiTilt is in after a connection drop - is it still sending data or are we back at the main menu?
A: The WiTilt is still sending data. In other words, data acquisition and data transfer functions are independent from each other. "Reset" only restarts the data acquisition part, while connect/disconnect only affects the data transfer part.
Q: How can I detect a reset on a connected computer? How do I restart data acqusition automatically after a reset?
A: When the reset button is pressed, the WiTilt sends a two characters, 0xE0 0xE0, then restarts and transmits the main menu. The time between sending 0xE0 and being responsive to input from the computer is approx. 2000ms. Hence you can detect a reset and restart a WiTilt with the following pseudocode:
if (serialIn.equals({0xE0,0xE0}) {
wait(2000);
serial.send({'1','S'}); //for binary mode
Q: What state is the WiTilt in after a power cycle - does it remember its configuration?
A: Yes it does. A power cycle always brings up the main menu, but the settings from last time are retained. So if you were last in Ascii mode, you will need to send a "1" to restart data acquisition. If you were in Binary mode, you will need to send a "1" followed by "S". But there's no need to reconfigure binary mode.
The following are observations that may be incorrect.
You can connect at most two WiTilts to a computer using the blueSoleil software. The program only allows you to open a max of 2 incoming bluetooth serial port connections. Their datasheet explains this on page 3 BlueSolei data sheet
However you can have three or more WiTilts so long as you only have at most two connected at the same time. To switch which ones are active and can be used in blueSolei go to tools, configurations, then quick connect and then reassign the one that has a COM port that is not working to a COM port that is working. For example if COM22 is assigned to the third WiTilt and you already have COM15 and COM16 working with the WiTilts remove one of those and asign the third to COM15 or COM16.
our Witilt IDs:
Page Information
|
Wiki Information |
Recent PBwiki Blog Posts |