Hardware Reference
In-Depth Information
BytestoSend[0] = 'a';
write(BytestoSend); // sends buffer to the ADK
Sync = true;
}
} // end void SyncData(View v)
After the updates described in this example are added to the ADK framework and a final check for errors is
done, the application can be uploaded to a target Android device. Start and run the openFrameworks program and
the Arduino without the Android connected, and let them run for a while to build some data in the log file. When a
sufficient amount of data is sent, connect the Android device without restarting the Arduino. A pop-up menu should
appear, asking for permission to run a program. Select the ADK Sensor Network program. Synchronize the data when
the program is ready, and observe the graph and compare to the one drawn by the openFrameworks program. The
red line in the openFrameworks program should match the last position of the Android graph.
The Android application may have to be forcefully stopped each time it is run because the thread sometimes
does not stop properly. More robust thread handling is required for final products.
Note
Summary
The example series in this chapter showed one method of integrating Android into a sensor network and provided
a review of other concepts introduced in other chapters of this topic. The possible combinations of what the sensor
network observes and measures and the different technologies that can be used to achieve a final product are
limitless. The example series is not intended to be a final product, but a starting point for further exploration into
sensor networks and integration. An extra challenge that can be tackled with this chapter's concepts is using a third
XBee module and another USB adapter connected to a different computer to add three more simulated sensors. The
most important thing about sensor networks, Arduino, and Android is that you should explore the technology to get
more familiar with more advanced techniques so you can use them in future projects.
 
 
Search WWH ::




Custom Search