<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="http://www.elinux.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://www.elinux.org/api.php?action=feedcontributions&amp;user=Astroricks&amp;feedformat=atom</id>
		<title>eLinux.org - User contributions [en]</title>
		<link rel="self" type="application/atom+xml" href="http://www.elinux.org/api.php?action=feedcontributions&amp;user=Astroricks&amp;feedformat=atom"/>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Special:Contributions/Astroricks"/>
		<updated>2013-05-20T16:32:52Z</updated>
		<subtitle>User contributions</subtitle>
		<generator>MediaWiki 1.21alpha</generator>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T06:28:07Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Theory of Operation */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
When the application is running, we suggest pressing the &amp;quot;setting&amp;quot; button first to enable the wall-cross mode, which could make it not so easily &amp;quot;game over&amp;quot;. To start the game, you need to press Up Arrow(or Arrows of other directions) on the keyboard. And the player would get a better playing experience if he/she stands in front of the Kinect with a distance of about 1.5m - 2m. The player should control the snake with his '''right hand''' moving up and down, left and right.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can modify the codes to change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together.&lt;br /&gt;
&lt;br /&gt;
=== The Control Strategy ===&lt;br /&gt;
Judging gestures simply from the changing of coordinate is hard and may lead to mistakes commonly. To improve the playing experience, we combined two methods to guess which control direction the player wants to make.&lt;br /&gt;
&lt;br /&gt;
1. Compare the current coordinate with the last time. When the date is refreshed, we can compare the current coordinate of player's right-hand withe the last time value. If the difference between the coordinates of x or y is larger than the threshold, it is reasonable to think that the player may want the snake to make a move in this direction.&lt;br /&gt;
&lt;br /&gt;
2. See where the hand locates. After making a upward movement, it has a high possibility that the y coordinate locates in the up area. Similar situation appears in other movement directions. So by checking the current value of the x and y coordinates we can know which direction the player want to make move.&lt;br /&gt;
&lt;br /&gt;
Only when the same direction is implied by both methods, we move the snake in this direction. It seems that this control strategy works pretty well.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:52:23Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Highlights */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
When the application is running, we suggest pressing the &amp;quot;setting&amp;quot; button first to enable the wall-cross mode, which could make it not so easily &amp;quot;game over&amp;quot;. To start the game, you need to press Up Arrow(or Arrows of other directions) on the keyboard. And the player would get a better playing experience if he/she stands in front of the Kinect with a distance of about 1.5m - 2m. The player should control the snake with his '''right hand''' moving up and down, left and right.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can modify the codes to change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:51:11Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* The Snake Game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
When the application is running, we suggest pressing the &amp;quot;setting&amp;quot; button first to enable the wall-cross mode, which could make it not so easily &amp;quot;game over&amp;quot;. To start the game, you need to press Up Arrow(or Arrows of other directions) on the keyboard. And the player would get a better playing experience if he/she stands in front of the Kinect with a distance of about 1.5m - 2m. The player should control the snake with his '''right hand''' moving up and down, left and right.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:38:51Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:38:37Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* The Snake Game */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples=== (if you want to)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:37:50Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Building and running samples=== (if you want to)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===The Snake Game===&lt;br /&gt;
&lt;br /&gt;
The Snake Game can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM. To play with it you should copy the folder to the root directory of SD card. Since what we did is combining the Snake Game source code into the Tracking Sample, running this application would be the same way as running the samples.&lt;br /&gt;
&lt;br /&gt;
We suggest playing with the following command:&lt;br /&gt;
&lt;br /&gt;
 beagle$ cd Tracking_Sanke/bin/&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws -upper&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T05:07:46Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
==== Overview ====&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
==== 1. Download the image package and burn it into the SD card ====&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 2. Run the sample application ====&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
==== 3. Setting up your Linux development PC ====&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==== 4. Setting up the BeagleBoard-xM ====&lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Building and running samples''' (if you want to)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''The Snake Game'''&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T04:55:09Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
=== Hardware ===&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
=== Software ===&lt;br /&gt;
&lt;br /&gt;
The source files for the project can be downloaded from https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM . Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
=== The Main Idea ===&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
=== The Technics Used ===&lt;br /&gt;
Technically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
=== Yue Zhang ===&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
=== Xinyu Cheng ===&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
=== Xia Li ===&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T04:52:21Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
'''Hardware'''&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
'''Software'''&lt;br /&gt;
&lt;br /&gt;
The source files for the project can be downloaded from [https://github.com/Astroricks/Snake-Game-with-Kinect-on-BeagleBoard-xM/tree/master/Tracking_Snake github]. Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Our project is about how to use Microsoft Kinect Sensor to play snake game by the motion of you right hand(You can change to any part of your body if you would like to). We set a score section to record the highest score. Anybody who want to break our record are welcome(Currently the record is holding by Xinyu Cheng at 260). We've created a play demo and uploaded it to YouTube:&lt;br /&gt;
&lt;br /&gt;
=== Play snake game with Kinect sensor on BeagleboardxM ===&lt;br /&gt;
{{#ev:youtube|uBW6LkVUi9I}}&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
Tenically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Yue_Zhang_Project</id>
		<title>ECE497 Yue Zhang Project</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Yue_Zhang_Project"/>
				<updated>2012-11-14T04:33:43Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: Blanked the page&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T04:03:28Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
'''Hardware'''&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
'''Software'''&lt;br /&gt;
&lt;br /&gt;
The source files for the project can be downloaded from'''github'''. Once you have set up the developing environment as in the following instructions, you can download the files, playing with the game or making changes.  &lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought, and errors came out occasionally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note: The following instruction is about how to set up the environment for developing. If you don't want to do the development, you can just skip that.&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
Tenically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T03:33:59Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
'''Hardware'''&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.microsoftstore.com/store/msstore/en_US/pd/ThemeID.27509700/Kinect-for-Xbox-360/productID.216507400 Kinect]&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Power Supply&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
Tenically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T03:31:32Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
'''Hardware'''&lt;br /&gt;
&lt;br /&gt;
1 x Kinect&lt;br /&gt;
&lt;br /&gt;
1 x [http://www.digikey.com/product-highlights/us/en/texas-instruments-beagleboard/685 BeagleBoard xM]&lt;br /&gt;
&lt;br /&gt;
1 x Keyboard&lt;br /&gt;
&lt;br /&gt;
1 x Mouse&lt;br /&gt;
&lt;br /&gt;
1 x DVI to HDMI wire&lt;br /&gt;
&lt;br /&gt;
1 x Power Supply&lt;br /&gt;
&lt;br /&gt;
1 x Monitor&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motion of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
Tenically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motion based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motion algorithm.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motion based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-14T03:03:01Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Executive Summary */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
I believe that almost every college students have played a game called &amp;quot;Greedy Snake&amp;quot; in our childhood. At that time, we played it on the cellphone, on the computer or on the PSP. However, we are always using the keyboard to control the games we played. Now, our final project could bring you something new, that is a &amp;quot;Gesture Controlled Greedy Snake&amp;quot;. It means that, using the gesture, the keyboard is never required to play the game. Amazing? Read the following wiki to know how we make it happens!&lt;br /&gt;
&lt;br /&gt;
Basically, we are using the kinect from Microsoft and the Beagle Board XM from Texas Instrument to accomplish our gesture game. The program for the game is programmed on the QT-Linux. Besides, we use the cross compiling to compile the program to make the game run on the beagle board.&lt;br /&gt;
&lt;br /&gt;
After our previous work, our &amp;quot;Gesture Greedy Snake&amp;quot; is completed, and works pretty good. The snake can be controlled by our gestures smoothly. The game reminds us a different style of childhood memory.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
 host$ cd ''&amp;lt;DownloadDirectory&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''Update:''The free version Qt Creator can not be used in this project since it doesn't have cross-compile option with it.&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible for us to get the coordinate of many joints of the body. In this case, we can judge the position and the motivation of our hands or any other joints. Then, we can use the direction we get from the previous judgement to control the Greedy Snake. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
Tenically, we can use QT to design our program and then cross-complie our project to the beagle-board. The Greedy Snake is an open-source QT game, and the tracking of the joint can be accomplished from modifying the Omek SDK. We have to modify both of their codes to connect the two parts together. &lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
* Implemented the motivation based algorithm which makes the application runs more smoothly.&lt;br /&gt;
* Programmed for the part of motivation algorithm.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Accomplished the cross-compiling on QT.&lt;br /&gt;
* Programming for the connection between the Snake Game and the Kinect SDK.&lt;br /&gt;
* Designed and Implemented the coordinate based algorithm.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided SDK demo.&lt;br /&gt;
* Speed up for the demo.&lt;br /&gt;
* Designed the motivation based algorithm. &lt;br /&gt;
* Programmed to improved the accuracy and speed of the game.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Now, our game can work pretty good and smoothly. The future work for the project will mainly about how to improve the user interface and the game rules. We can also improve our algorithm for the direction judgement.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Conculsionly, our project works pretty good. Our Greedy Snake game runs very good and brings a lot of fun for us. During the develop process, we met lots of difficulties, we tried to solve them one by one. Finally, we solved almost all the problems and end up with a nice project.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Contributions_and_Project_Status</id>
		<title>ECE497 Contributions and Project Status</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Contributions_and_Project_Status"/>
				<updated>2012-11-13T21:40:18Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Project Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Contributions]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
Please edit this page and add your project to this list.&lt;br /&gt;
Please make the list alphabetical by family name.&lt;br /&gt;
&lt;br /&gt;
Take a look at what you and others have contributed.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! Contributions&lt;br /&gt;
! Project&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [[Special:Contributions/atniptw|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/atniptw/ atniptw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jessebrannon | Jesse Brannon]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/brannojs/ brannojs]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Xinyu1991 | Xinyu Cheng]]&lt;br /&gt;
| [[Special:Contributions/Xinyu1991|contrib]]&lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/xinyu1991/ Xinyu Cheng]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:correlbn | Bryan Correll]]&lt;br /&gt;
| [[Special:Contributions/correlbn|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:draneaw | Alex Drane]]&lt;br /&gt;
| [[Special:Contributions/draneaw|contrib]]&lt;br /&gt;
| [[ECE497: Remote Web Cam Viewer Final Project| Remote Web Cam Viewer]]&lt;br /&gt;
| [https://github.com/draneaw/ Draneaw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:duganje | Josh Dugan]]&lt;br /&gt;
| [[Special:Contributions/duganje|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/duganje/ duganje]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Geislekj | Kevin Geisler]]&lt;br /&gt;
| [[Special:Contributions/geislekj|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/geislekj/ geislekj]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:chris.good | Christopher A Good]]&lt;br /&gt;
| [[Special:Contributions/Chris.good|contrib]]&lt;br /&gt;
| [[ECE497 Project RoverGUI | RoverGUI]]&lt;br /&gt;
| [https://github.com/goodca/ goodca]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [[Special:Contributions/hansenrl|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/hansenrl/ Hansenrl]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:jungeml | Michael Junge]]&lt;br /&gt;
| [[Special:Contributions/jungeml|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/jungeml/ Jungeml]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:larmorgs | Greg Larmore]]&lt;br /&gt;
| [[Special:Contributions/larmorgs|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/larmorgs Greg Larmore]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lobdeljt | John Lobdell]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE 497 lobdeljt Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jtlobdell jtlobdell]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lix | Xia Li]]&lt;br /&gt;
| [[Special:Contributions/Lix|contrib]]&lt;br /&gt;
| [[ECE497 Project: Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/1984xiali/ xiali]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Millerap | Andrew Miller]]&lt;br /&gt;
| [[Special:Contributions/Millerap|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/millerap millerap]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mmoravec | Matthew Moravec]]&lt;br /&gt;
| [[Special:Contributions/mmoravec|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/mmoravec/ mmoravec]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ngop | Peter Ngo]]&lt;br /&gt;
| [[Special:Contributions/ngop|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/ngop/ ngop]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Popenhjc | James Popenhagen]]&lt;br /&gt;
| [[Special:Contributions/Popenhjc|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/popenhjc/ popenhjc]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Richarsm | Sean Richardson]]&lt;br /&gt;
| [[Special:Contributions/Richarsm|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/seanrich Sean Richardson]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:shinnsm|Stephen Shinn]]&lt;br /&gt;
| [[Special:Contributions/shinnsm|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/shinnsm shinnsm]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Whiteer | Elias White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 SLAM via ROS | My Beagle Project]]&lt;br /&gt;
| [https://github.com/whiteer whiteer]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ruff | Ruffin White]]&lt;br /&gt;
| [[Special:Contributions/ruff|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/ruffsl/ ruffsl]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Yoder | Mark A. Yoder]]&lt;br /&gt;
| [[Special:Contributions/Yoder | contrib]]&lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/MarkAYoder MarkAYoder]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Astroricks | Yue Zhang]]&lt;br /&gt;
| [[Special:Contributions/Astroricks | contrib]]&lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yuming | Yuming Cao]]&lt;br /&gt;
# [[Special:Contributions/Yifei | Yifei Li]]&lt;br /&gt;
# [[Special:Contributions/Harrisgw | Greg Harrison]]&lt;br /&gt;
# [[Special:Contributions/mac | Jack Ma]]&lt;br /&gt;
# [[Special:Contributions/Gemini91 | Guanqun Wang]]&lt;br /&gt;
# [[Special:Contributions/Yanj | Mona Yan]]&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]&lt;br /&gt;
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | David Zitnik]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | Alex Drane]]&lt;br /&gt;
# [[Special:Contributions/jessebrannon | Jesse Brannon]]&lt;br /&gt;
# [[Special:Contributions/larmorgs | Greg Larmore]]&lt;br /&gt;
# [[Special:Contributions/jungeml | Michael Junge]]&lt;br /&gt;
# [[Special:Contributions/millerap | Andrew Miller]]&lt;br /&gt;
# [[Special:Contributions/correlbn | Bryan Correll]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]&lt;br /&gt;
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]&lt;br /&gt;
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]&lt;br /&gt;
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]&lt;br /&gt;
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Contributions_and_Project_Status</id>
		<title>ECE497 Contributions and Project Status</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Contributions_and_Project_Status"/>
				<updated>2012-11-13T21:39:50Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Project Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Contributions]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
Please edit this page and add your project to this list.&lt;br /&gt;
Please make the list alphabetical by family name.&lt;br /&gt;
&lt;br /&gt;
Take a look at what you and others have contributed.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! Contributions&lt;br /&gt;
! Project&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [[Special:Contributions/atniptw|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/atniptw/ atniptw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jessebrannon | Jesse Brannon]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/brannojs/ brannojs]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Xinyu1991 | Xinyu Cheng]]&lt;br /&gt;
| [[Special:Contributions/Xinyu1991|contrib]]&lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/xinyu1991/ Xinyu Cheng]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:correlbn | Bryan Correll]]&lt;br /&gt;
| [[Special:Contributions/correlbn|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:draneaw | Alex Drane]]&lt;br /&gt;
| [[Special:Contributions/draneaw|contrib]]&lt;br /&gt;
| [[ECE497: Remote Web Cam Viewer Final Project| Remote Web Cam Viewer]]&lt;br /&gt;
| [https://github.com/draneaw/ Draneaw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:duganje | Josh Dugan]]&lt;br /&gt;
| [[Special:Contributions/duganje|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/duganje/ duganje]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Geislekj | Kevin Geisler]]&lt;br /&gt;
| [[Special:Contributions/geislekj|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/geislekj/ geislekj]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:chris.good | Christopher A Good]]&lt;br /&gt;
| [[Special:Contributions/Chris.good|contrib]]&lt;br /&gt;
| [[ECE497 Project RoverGUI | RoverGUI]]&lt;br /&gt;
| [https://github.com/goodca/ goodca]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [[Special:Contributions/hansenrl|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/hansenrl/ Hansenrl]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:jungeml | Michael Junge]]&lt;br /&gt;
| [[Special:Contributions/jungeml|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/jungeml/ Jungeml]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:larmorgs | Greg Larmore]]&lt;br /&gt;
| [[Special:Contributions/larmorgs|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/larmorgs Greg Larmore]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lobdeljt | John Lobdell]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE 497 lobdeljt Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jtlobdell jtlobdell]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lix | Xia Li]]&lt;br /&gt;
| [[Special:Contributions/Lix|contrib]]&lt;br /&gt;
| [[ECE497 Project: Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/1984xiali/ xiali]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Millerap | Andrew Miller]]&lt;br /&gt;
| [[Special:Contributions/Millerap|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/millerap millerap]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mmoravec | Matthew Moravec]]&lt;br /&gt;
| [[Special:Contributions/mmoravec|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/mmoravec/ mmoravec]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ngop | Peter Ngo]]&lt;br /&gt;
| [[Special:Contributions/ngop|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/ngop/ ngop]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Popenhjc | James Popenhagen]]&lt;br /&gt;
| [[Special:Contributions/Popenhjc|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/popenhjc/ popenhjc]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Richarsm | Sean Richardson]]&lt;br /&gt;
| [[Special:Contributions/Richarsm|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/seanrich Sean Richardson]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:shinnsm|Stephen Shinn]]&lt;br /&gt;
| [[Special:Contributions/shinnsm|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/shinnsm shinnsm]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Whiteer | Elias White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 SLAM via ROS | My Beagle Project]]&lt;br /&gt;
| [https://github.com/whiteer whiteer]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ruff | Ruffin White]]&lt;br /&gt;
| [[Special:Contributions/ruff|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/ruffsl/ ruffsl]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Yoder | Mark A. Yoder]]&lt;br /&gt;
| [[Special:Contributions/Yoder | contrib]]&lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/MarkAYoder MarkAYoder]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Astroricks | Yue Zhang]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [[Special:Contributions/Astroricks | contrib]]&lt;br /&gt;
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yuming | Yuming Cao]]&lt;br /&gt;
# [[Special:Contributions/Yifei | Yifei Li]]&lt;br /&gt;
# [[Special:Contributions/Harrisgw | Greg Harrison]]&lt;br /&gt;
# [[Special:Contributions/mac | Jack Ma]]&lt;br /&gt;
# [[Special:Contributions/Gemini91 | Guanqun Wang]]&lt;br /&gt;
# [[Special:Contributions/Yanj | Mona Yan]]&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]&lt;br /&gt;
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | David Zitnik]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | Alex Drane]]&lt;br /&gt;
# [[Special:Contributions/jessebrannon | Jesse Brannon]]&lt;br /&gt;
# [[Special:Contributions/larmorgs | Greg Larmore]]&lt;br /&gt;
# [[Special:Contributions/jungeml | Michael Junge]]&lt;br /&gt;
# [[Special:Contributions/millerap | Andrew Miller]]&lt;br /&gt;
# [[Special:Contributions/correlbn | Bryan Correll]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]&lt;br /&gt;
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]&lt;br /&gt;
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]&lt;br /&gt;
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]&lt;br /&gt;
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/User:Xinyu1991</id>
		<title>User:Xinyu1991</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/User:Xinyu1991"/>
				<updated>2012-11-11T01:56:20Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category: ECE497 |UX]]&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-08T20:33:17Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [http://get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Contributions_and_Project_Status</id>
		<title>ECE497 Contributions and Project Status</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Contributions_and_Project_Status"/>
				<updated>2012-11-08T20:26:25Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Project Status */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Contributions]]&lt;br /&gt;
{{YoderHead}}&lt;br /&gt;
&lt;br /&gt;
== Fall 2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
Please edit this page and add your project to this list.&lt;br /&gt;
Please make the list alphabetical by family name.&lt;br /&gt;
&lt;br /&gt;
Take a look at what you and others have contributed.&lt;br /&gt;
&lt;br /&gt;
{|&lt;br /&gt;
|- &lt;br /&gt;
! Name&lt;br /&gt;
! Contributions&lt;br /&gt;
! Project&lt;br /&gt;
! git repository&lt;br /&gt;
|-&lt;br /&gt;
| [[User:atniptw | Tom Atnip]]&lt;br /&gt;
| [[Special:Contributions/atniptw|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/atniptw/ atniptw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:jessebrannon | Jesse Brannon]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/brannojs/ brannojs]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Xinyu1991 | Xinyu Cheng]]&lt;br /&gt;
| [[Special:Contributions/Xinyu1991|contrib]]&lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/xinyu1991/ Xinyu Cheng]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:correlbn | Bryan Correll]]&lt;br /&gt;
| [[Special:Contributions/correlbn|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/correlbn/My-Beagle-Project/ Correlbn]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:draneaw | Alex Drane]]&lt;br /&gt;
| [[Special:Contributions/draneaw|contrib]]&lt;br /&gt;
| [[ECE497: Remote Web Cam Viewer Final Project| Remote Web Cam Viewer]]&lt;br /&gt;
| [https://github.com/draneaw/ Draneaw]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:duganje | Josh Dugan]]&lt;br /&gt;
| [[Special:Contributions/duganje|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/duganje/ duganje]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Geislekj | Kevin Geisler]]&lt;br /&gt;
| [[Special:Contributions/geislekj|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/geislekj/ geislekj]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:chris.good | Christopher A Good]]&lt;br /&gt;
| [[Special:Contributions/Chris.good|contrib]]&lt;br /&gt;
| [[ECE497 Project RoverGUI | RoverGUI]]&lt;br /&gt;
| [https://github.com/goodca/ goodca]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:hansenrl | Ross Hansen]]&lt;br /&gt;
| [[Special:Contributions/hansenrl|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/hansenrl/ Hansenrl]&lt;br /&gt;
| &lt;br /&gt;
|-&lt;br /&gt;
| [[User:jungeml | Michael Junge]]&lt;br /&gt;
| [[Special:Contributions/jungeml|contrib]]&lt;br /&gt;
| [[ECE497 Project Rover | Rover]]&lt;br /&gt;
| [https://github.com/jungeml/ Jungeml]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:larmorgs | Greg Larmore]]&lt;br /&gt;
| [[Special:Contributions/larmorgs|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/larmorgs Greg Larmore]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lobdeljt | John Lobdell]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE 497 lobdeljt Project | My Beagle Project]]&lt;br /&gt;
| [https://github.com/jtlobdell jtlobdell]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Lix | Xia Li]]&lt;br /&gt;
| [[Special:Contributions/Lix|contrib]]&lt;br /&gt;
| [[ECE497 Project: Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/1984xiali/ xiali]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Millerap | Andrew Miller]]&lt;br /&gt;
| [[Special:Contributions/Millerap|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/millerap millerap]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:mmoravec | Matthew Moravec]]&lt;br /&gt;
| [[Special:Contributions/mmoravec|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/mmoravec/ mmoravec]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ngop | Peter Ngo]]&lt;br /&gt;
| [[Special:Contributions/ngop|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/ngop/ ngop]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Popenhjc | James Popenhagen]]&lt;br /&gt;
| [[Special:Contributions/Popenhjc|contrib]]&lt;br /&gt;
| [[BeagleBone PRU | BeagleBone PRU]]&lt;br /&gt;
| [https://github.com/popenhjc/ popenhjc]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Richarsm | Sean Richardson]]&lt;br /&gt;
| [[Special:Contributions/Richarsm|contrib]]&lt;br /&gt;
| [[ECE497 SPI Project | SPI Project]]&lt;br /&gt;
| [https://github.com/seanrich Sean Richardson]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:shinnsm|Stephen Shinn]]&lt;br /&gt;
| [[Special:Contributions/shinnsm|contrib]]&lt;br /&gt;
| [[ECE497 Project: XBee|XBee]]&lt;br /&gt;
| [https://github.com/shinnsm shinnsm]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Whiteer | Elias White]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497 SLAM via ROS | My Beagle Project]]&lt;br /&gt;
| [https://github.com/whiteer whiteer]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:ruff | Ruffin White]]&lt;br /&gt;
| [[Special:Contributions/ruff|contrib]]&lt;br /&gt;
| [[ECE497 Beagle VNS | Beagle VNS]]&lt;br /&gt;
| [https://github.com/ruffsl/ ruffsl]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Yoder | Mark A. Yoder]]&lt;br /&gt;
| [[Special:Contributions/Yoder | contrib]]&lt;br /&gt;
| [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
| [https://github.com/MarkAYoder MarkAYoder]&lt;br /&gt;
|-&lt;br /&gt;
| [[User:Astroricks | Yue Zhang]]&lt;br /&gt;
| &lt;br /&gt;
| [[ECE497_Project:_Kinect | Kinect]]&lt;br /&gt;
| [https://github.com/Astroricks/Beagle-Project Yue Zhang]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Winter 2011-2012 ==&lt;br /&gt;
&lt;br /&gt;
=== Contributions ===&lt;br /&gt;
&lt;br /&gt;
# [[Special:Contributions/Yuming | Yuming Cao]]&lt;br /&gt;
# [[Special:Contributions/Yifei | Yifei Li]]&lt;br /&gt;
# [[Special:Contributions/Harrisgw | Greg Harrison]]&lt;br /&gt;
# [[Special:Contributions/mac | Jack Ma]]&lt;br /&gt;
# [[Special:Contributions/Gemini91 | Guanqun Wang]]&lt;br /&gt;
# [[Special:Contributions/Yanj | Mona Yan]]&lt;br /&gt;
# [[Special:Contributions/Yoder | Mark A. Yoder]]&lt;br /&gt;
# [[Special:Contributions/Yuhasmj | Michael Yuhas]]&lt;br /&gt;
# [[Special:Contributions/Ziyi Zhang | Ziyi Zhang]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | David Zitnik]]&lt;br /&gt;
# [[Special:Contributions/Zitnikdj | Alex Drane]]&lt;br /&gt;
# [[Special:Contributions/jessebrannon | Jesse Brannon]]&lt;br /&gt;
# [[Special:Contributions/larmorgs | Greg Larmore]]&lt;br /&gt;
# [[Special:Contributions/jungeml | Michael Junge]]&lt;br /&gt;
# [[Special:Contributions/millerap | Andrew Miller]]&lt;br /&gt;
# [[Special:Contributions/correlbn | Bryan Correll]]&lt;br /&gt;
&lt;br /&gt;
=== Project Status ===&lt;br /&gt;
&lt;br /&gt;
# [[User:Yoder | Mark A. Yoder]], [[ECE497 Project Template | My Beagle Project]]&lt;br /&gt;
# [[user:Yanj|Mona Yan]] and [[user:Harrisgw| Greg Harrison]], [[PS EYE QT PROJECT | Playstation Eye Audio with Qt]]&lt;br /&gt;
# [[user:Caogecym | Yuming Cao]] and [[user:Ziyi Zhang | Ziyi Zhang]], [[Node.js Weather Station]]&lt;br /&gt;
# [[user:Yifei| Yifei Li]] and [[user:Gemini91| Guanqun Wang]], [[ Kinect Project | Play games using Kinect on Beagleboard]]&lt;br /&gt;
# [[user:Yuhasmj| Michael J. Yuhas]] and [[user:mac | Jack Ma]], [[ Multiple Partitions via U-boot | Multiple Partitions via U-boot ]]&lt;br /&gt;
# [[user:Zitnikdj| David Zitnik]], [[ ECE497 Project: Twitter Java Application | Twitter Java Application ]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/User:Astroricks</id>
		<title>User:Astroricks</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/User:Astroricks"/>
				<updated>2012-11-08T16:50:00Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Yue Zhang&lt;br /&gt;
&lt;br /&gt;
Electrical and Computer Engineering Major, Class of 2012.&lt;br /&gt;
[[Category:ECE497 |Ua]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[ECE497 Yue Zhang Project]]&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T16:56:02Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page, and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and not detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T09:23:19Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T09:21:42Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* User Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
To build QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Start Qt Creator.&lt;br /&gt;
&lt;br /&gt;
2. Go to: File &amp;gt; Open File or Project, select the QtTracking-SDK.pro project (from Beckon-SDK-{version}/samples/QtTracking) and click Open. Select Embedded Linux instead of Desktop.&lt;br /&gt;
&lt;br /&gt;
3. Click Finish.&lt;br /&gt;
&lt;br /&gt;
4. Go to Projects tab (on the left), In Qt version select Qt [4.x.x (qt-arm)]/.&lt;br /&gt;
&lt;br /&gt;
5. Run Build -&amp;gt; Build Project command.&lt;br /&gt;
&lt;br /&gt;
The result executable can be found in the Beckon-SDK-{version}/bin directory.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
To run the QtTracking Sample:&lt;br /&gt;
&lt;br /&gt;
1. Mount or copy the bin directory to the BeagleBoard.&lt;br /&gt;
&lt;br /&gt;
''Note: Run the reset.sh script inside the &amp;quot;bin&amp;quot; folder of the SDK before each sample run, to reset the DSP.''&lt;br /&gt;
&lt;br /&gt;
Run the following:&lt;br /&gt;
&lt;br /&gt;
 beagle$ ./QtTracking-SDK –qws&lt;br /&gt;
&lt;br /&gt;
''Note: Developer's guide has more instructions on running the sample''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Others are coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T09:11:26Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
After Qt Creator is successfully installed, start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T09:09:25Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain:&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
2) Install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Newest version of Qt libraries can be found [http://qt-project.org/downloads/ here]. We didn't test it since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (see this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
3) Install and set up Qt Creator:&lt;br /&gt;
&lt;br /&gt;
Go to http://qt-project.org/downloads to download Qt. Get the latest version of Qt for Linux/X11; be sure to get the appropriate 32bit or 64bit version. Once downloaded go to the download directory and execute the following using your download file name:&lt;br /&gt;
&lt;br /&gt;
 host$ chmod u+x ''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
 host$ ./''&amp;lt;QtCreator.bin&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
''To '''Li Xia''': Qt Creator has commercial version on http://qt.nokia.com/downloads . I'm using it but I can only try it for 30 days. I just find the free version above but haven't tried it. Please try the free version and see if it works. If nothing's wrong, just simply remove this paragraph afterwards.''&lt;br /&gt;
&lt;br /&gt;
Start Qt Creator. Go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Tool Chains, select Add -&amp;gt; GCC and insert the full compiler path below:&lt;br /&gt;
&lt;br /&gt;
/usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
Then go to: Tools &amp;gt; Options &amp;gt; Build &amp;amp; Run &amp;gt; Qt Versions, select Add and provide the following full path to qmake&lt;br /&gt;
&lt;br /&gt;
/opt/qt-arm/bin/qmake&lt;br /&gt;
&lt;br /&gt;
Press Apply and OK.&lt;br /&gt;
&lt;br /&gt;
4. Setting up the BeagleBoard-xM &lt;br /&gt;
&lt;br /&gt;
All of the Qt files that you need to move to the BeagleBoard can be found in the /opt/qt-arm/lib directory on your Linux Build System. Copy all the files out of your build system's /opt/qt-arm/lib directory and put those into the BeagleBoard-xM's /opt/qt-arm/lib directory. You can get the files to the Beagleboard by either networking, using a usb drive or plug the SD card into your Linux Build System.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T08:23:31Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.) Instructions in this [http://treyweaver.blogspot.com/2010/10/setting-up-qt-development-environment.html blog] are also very useful.&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain. &lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
2) To install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that you have your cross compiler installed, you can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux [get.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.2.tar.gz here]. &lt;br /&gt;
&lt;br /&gt;
''Note: Higher versions of Qt libraries can be found [http://get.qt.nokia.com/qt/source/ here]. We didn't test them since the 4.6.2 version works fine.''&lt;br /&gt;
&lt;br /&gt;
Extract the file you just downloaded:&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;DownloadFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
You need to create a new make.conf. Run the following line to make a new mkspecs directory for the BeagleBoard Processor.&lt;br /&gt;
&lt;br /&gt;
 host$ cp -R ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-arm-g++/ ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/&lt;br /&gt;
&lt;br /&gt;
Edit the qmake.conf file found in ''&amp;lt;DownloadDirectory&amp;gt;''/mkspecs/qws/linux-DM3730-g++/ and overwrite it with the following lines.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#&lt;br /&gt;
# qmake configuration for building with arm-linux-g++&lt;br /&gt;
#&lt;br /&gt;
&lt;br /&gt;
include(../../common/g++.conf)&lt;br /&gt;
include(../../common/linux.conf)&lt;br /&gt;
include(../../common/qws.conf)&lt;br /&gt;
&lt;br /&gt;
# modifications to g++.conf&lt;br /&gt;
#Toolchain&lt;br /&gt;
&lt;br /&gt;
#Compiler Flags to take advantage of the ARM architecture&lt;br /&gt;
QMAKE_CFLAGS_RELEASE =   -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -mfloat-abi=softfp&lt;br /&gt;
&lt;br /&gt;
QMAKE_CC = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/gcc&lt;br /&gt;
QMAKE_CXX = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
QMAKE_LINK_SHLIB = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/g++&lt;br /&gt;
&lt;br /&gt;
# modifications to linux.conf&lt;br /&gt;
QMAKE_AR = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/ar cqs&lt;br /&gt;
QMAKE_OBJCOPY = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/objcopy&lt;br /&gt;
QMAKE_STRIP = /usr/local/angstrom/arm/arm-angstrom-linux-gnueabi/bin/strip&lt;br /&gt;
&lt;br /&gt;
load(qt_config)&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Now run the configure command (this can take many minutes):&lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu:&lt;br /&gt;
&lt;br /&gt;
 host$ ./configure -opensource -confirm-license -prefix /opt/qt-arm -no-qt3support -embedded arm -little-endian -platform qws/linux-x86_64-g++ -xplatform qws/linux-DM3730-g++ -qtlibinfix E&lt;br /&gt;
&lt;br /&gt;
See this [http://processors.wiki.ti.com/index.php/Building_Qt website] for more details if needed.&lt;br /&gt;
&lt;br /&gt;
Once this is complete you can run make and make install (make may take some hours):&lt;br /&gt;
&lt;br /&gt;
 host$ make&lt;br /&gt;
 host$ sudo make install&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T07:15:40Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project is using kinect to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.)&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
&lt;br /&gt;
Download the image package [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-Image-2.4.19872.tar.gz] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''&amp;lt;ImageFileName&amp;gt;''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''&amp;lt;sdX&amp;gt;'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Note: This action will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
2. Run the sample application&lt;br /&gt;
&lt;br /&gt;
Plug the sensor into the BeagleBoard-xM USB port. Ensure the mouse and keyboard are connected to the BeagleBoard-xM USB port. Connect the BeagleBoard-xM to the monitor with an HDMI cable. Connect the BeagleBoard-xM power supply and wait for the boot process to reach the login prompt, login as user root (no password is required). Now it's ready to run the sample applications on the BeagleBoard-xM.&lt;br /&gt;
&lt;br /&gt;
''Note: Details about running the samples can be found in the developer's guide from page 9 to 11. The Kinect will react properly only if the player is within an appropriate distance (about 1m - 5m). ''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
3. Setting up your Linux development PC&lt;br /&gt;
&lt;br /&gt;
Download [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Beckon-SDK-2.4.19872.tar.gz] and extract it onto your host PC (this is the actual SDK which contains headers, libraries, documentation, makefiles, etc...) The SDK provides the tools to develop a motion-tracking and gesture-based application that can run on the BeagleBoard-xM. After developing the application, cross-compile it onto the Linux PC and then copy the image onto the BeagleBoard-xM via external USB storage.&lt;br /&gt;
&lt;br /&gt;
1) Download the Linux ARM cross toolchain. &lt;br /&gt;
&lt;br /&gt;
For 32-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-i686-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
For 64-bit Ubuntu you will want to download this file: http://www.angstrom-distribution.org/toolchains/angstrom-2011.03-x86_64-linux-armv7a-linux-gnueabi-toolchain-qte-4.6.3.tar.bz2&lt;br /&gt;
&lt;br /&gt;
Extract the downloaded archive into your system root directory:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo tar -xvjf ''&amp;lt;ToolchainFileName&amp;gt;'' -C /&lt;br /&gt;
&lt;br /&gt;
''Note: If you extract the archive into a different directory, you should adjust the following instructions as well as the samples' makefiles accordingly.''&lt;br /&gt;
&lt;br /&gt;
2) To install the Qt embedded SDK for Angstrom/BeagleBoard:&lt;br /&gt;
&lt;br /&gt;
Now that we have our cross compiler installed, we can compile Qt with it. First thing to do is to install zlib library:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install zlib1g-dev&lt;br /&gt;
&lt;br /&gt;
Then download the Open Source LGPL version of Qt libraries 4.6.2 for Embedded Linux here.  Remember your download directory, you will need it for the following steps.&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Coming soon.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
We are using the kinect as the sensor of our project. The provided algorithm of the kinect make it possible to recognize our gesture and motion. In this case, the gesture and motion can take the place of the mouse. Our project is running with the idea.&lt;br /&gt;
&lt;br /&gt;
We can use QT to design our program and then cross-complie our project to the beagle-board. According to the cross-compiling of the sample project: Tracking-SDK, we have got a pretty good demo. Hence, it is possible for us to design an interesting gesture game on the QT platform and then run it on the beagle board with the kinect.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
* '''Previous Work Breakdown:'''&lt;br /&gt;
''' Yue Zhang '''&lt;br /&gt;
* Researched how to Burn the correct Image to the Beagle Board.&lt;br /&gt;
* Configure the Beagle Board to control the kinect.&lt;br /&gt;
''' Xinyu Cheng '''&lt;br /&gt;
* Researched how to configure the QT programming environment. &lt;br /&gt;
* Realize the cross-compiling on QT.&lt;br /&gt;
''' Xia Li '''&lt;br /&gt;
* Researched how to run the provided demo.&lt;br /&gt;
* How to speed up the demo.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T06:04:55Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project aims to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.)&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
Download the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation image package] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&lt;br /&gt;
 host$ tar -xvzf ''imagefilename''&lt;br /&gt;
&lt;br /&gt;
Run the following command to make sure you have bash installed.&lt;br /&gt;
&lt;br /&gt;
 host$ sudo apt-get install bash&lt;br /&gt;
&lt;br /&gt;
Insert your SD card using a card reader/writer. Run the following command:&lt;br /&gt;
&lt;br /&gt;
 host$ sudo bash mkcard.sh /dev/''sdX'' beagle-omek&lt;br /&gt;
&lt;br /&gt;
''Warning: This move will wipe out and rewrite the SD card so make sure the files in it are backed up. The name of the SD card can be viewed in Disk Utility. If you mistakenly use the main OS device name this script can erase your entire OS.''  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T05:47:47Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project aims to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.)&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
Download the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation image package] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar -xvzf '''imagefilename'''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T05:43:18Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project aims to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.)&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the image package and burn it into the SD card&lt;br /&gt;
Download the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation image package] as mentioned above onto your Linux PC. Then extract it by entering&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tar -xvzf ''imagefilename''&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T05:34:59Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project aims to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Installation] page and a developer's guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation documentation] page. (You may need to register first.)&lt;br /&gt;
&lt;br /&gt;
Although the developer's guide introduces how to do the installation and configuration, we have found that it takes much longer than we originally thought and errors came out occationally. It seems that the developer's guide is not very well organized and detailed enought anyway. So we arranged our instruction and configuration procedures as below:&lt;br /&gt;
&lt;br /&gt;
1. Download the Image Package and Burn the Image onto the SD card&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T05:18:20Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Installation Instructions */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Our project aims to accomplish a kind of &amp;quot;Gesture Game&amp;quot;, which is operated through our gestures and motions. Compared to the traditional games, the gesture game can provide better interactive enjoy without the complex operation from the keyboard and mouse.&lt;br /&gt;
&lt;br /&gt;
Through our previous work, we have alread completed the configuration of our project successfully. The configuration work includes the configure of the Beagle Board and the configure of the QT IDE. Now, we can run the Tracking Demo and the Gesture Demo on the Beagle Board. We can also download our projects to the Beagle Board through cross-compiling.&lt;br /&gt;
&lt;br /&gt;
Our work ahead is looking for an interative game, and transplant the game to the QT platform. Then, download the game to the Beagle Board. In that case, the game can be played on the Kinect.&lt;br /&gt;
&lt;br /&gt;
Until now, we have a good begining with the demos runs succefully. We still need some time to finish the following work.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
We are using the drivers provided by [http://www.omekinteractive.com/ Omek]. The driver files can be found at the Beckon™ SDK 2.4 – BeagleBoard-xM Edition [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/32/11/installation Installation] page and a detailed developer guide is provided at the [http://support.omekinteractive.com/index.php?/TI/managedownloads/Download/View/34/11/documentation] page. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Our future work is to design an interactive game which can be controlled through our gestures.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T04:38:48Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]], [[user:Xinyu1991|Xinyu Cheng]], [[user:Lix|Xia Li]].&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Give two sentence intro to the project.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
&lt;br /&gt;
The sentence count is approximate and only to give an idea of the expected length.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T04:38:19Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang]] [[user:Xinyu1991|Xinyu Cheng]] [[user:Lix|Xia Li]]&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Give two sentence intro to the project.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
&lt;br /&gt;
The sentence count is approximate and only to give an idea of the expected length.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T04:37:51Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [user:Astroricks|Yue Zhang] [user:Xinyu1991|Xinyu Cheng] [user:Lix|Xia Li]&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Give two sentence intro to the project.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
&lt;br /&gt;
The sentence count is approximate and only to give an idea of the expected length.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/ECE497_Project:_Kinect</id>
		<title>ECE497 Project: Kinect</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/ECE497_Project:_Kinect"/>
				<updated>2012-11-05T04:36:47Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: Created page with &amp;quot;Project  Team members: [[user:Astroricks|Yue Zhang][user:Xinyu1991|Xinyu Cheng][user:Lix|Xia Li]]  == Grading Template == I'm using the following template...&amp;quot;&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497 |Project]]&lt;br /&gt;
&lt;br /&gt;
Team members: [[user:Astroricks|Yue Zhang][user:Xinyu1991|Xinyu Cheng][user:Lix|Xia Li]]&lt;br /&gt;
&lt;br /&gt;
== Grading Template ==&lt;br /&gt;
I'm using the following template to grade.  Each slot is 10 points.&lt;br /&gt;
0 = Missing, 5=OK, 10=Wow!&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
00 Executive Summary&lt;br /&gt;
00 Installation Instructions&lt;br /&gt;
00 User Instructions&lt;br /&gt;
00 Highlights&lt;br /&gt;
00 Theory of Operation&lt;br /&gt;
00 Work Breakdown&lt;br /&gt;
00 Future Work&lt;br /&gt;
00 Conclusions&lt;br /&gt;
00 Demo&lt;br /&gt;
00 Late&lt;br /&gt;
Comments:&lt;br /&gt;
&lt;br /&gt;
Score:  00/100&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;span style=&amp;quot;color:red&amp;quot;&amp;gt;(Inline Comment)&amp;lt;/span&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Executive Summary ==&lt;br /&gt;
&lt;br /&gt;
Give two sentence intro to the project.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what works.&lt;br /&gt;
&lt;br /&gt;
Give two sentences telling what isn't working.&lt;br /&gt;
&lt;br /&gt;
End with a two sentence conclusion.&lt;br /&gt;
&lt;br /&gt;
The sentence count is approximate and only to give an idea of the expected length.&lt;br /&gt;
&lt;br /&gt;
== Installation Instructions ==&lt;br /&gt;
&lt;br /&gt;
Give step by step instructions on how to install your project on the SPEd2 image.  &lt;br /&gt;
&lt;br /&gt;
* Include your [https://github.com/ github] path as a link like this:  [https://github.com/MarkAYoder/gitLearn https://github.com/MarkAYoder/gitLearn].  &lt;br /&gt;
* Include any additional packages installed via '''opkg'''.&lt;br /&gt;
* Include kernel mods.&lt;br /&gt;
* If there is extra hardware needed, include links to where it can be obtained.&lt;br /&gt;
&lt;br /&gt;
== User Instructions ==&lt;br /&gt;
&lt;br /&gt;
Once everything is installed, how do you use the program?  Give details here, so if you have a long user manual, link to it here.&lt;br /&gt;
&lt;br /&gt;
== Highlights ==&lt;br /&gt;
&lt;br /&gt;
Here is where you brag about what your project can do.&lt;br /&gt;
&lt;br /&gt;
Include a [http://www.youtube.com/ YouTube] demo.&lt;br /&gt;
&lt;br /&gt;
== Theory of Operation ==&lt;br /&gt;
&lt;br /&gt;
Give a high level overview of the structure of your software.  Are you using GStreamer?  Show a diagram of the pipeline.  Are you running multiple tasks?  Show what they do and how they interact.&lt;br /&gt;
&lt;br /&gt;
== Work Breakdown ==&lt;br /&gt;
&lt;br /&gt;
List the major tasks in your project and who did what.&lt;br /&gt;
&lt;br /&gt;
Also list here what doesn't work yet and when you think it will be finished and who is finishing it.&lt;br /&gt;
&lt;br /&gt;
== Future Work ==&lt;br /&gt;
&lt;br /&gt;
Suggest addition things that could be done with this project.&lt;br /&gt;
&lt;br /&gt;
== Conclusions ==&lt;br /&gt;
&lt;br /&gt;
Give some concluding thoughts about the project. Suggest some future additions that could make it even more interesting.&lt;br /&gt;
&lt;br /&gt;
{{YoderFoot}}&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-23T19:54:47Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Moravec&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Yue&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 0  No git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    8&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
[[File:DOT MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FROWN MATRIX.JPG|500px]] [[File:SMILE MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main codes are listed as below. And all the resources including the header files can be found on [https://github.com/Astroricks/Beagle-Project/tree/master/Miniproject02 Github:Astroricks].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-23T19:54:00Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Moravec&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Yue&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 0  No git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    8&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
[[File:DOT MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FROWN MATRIX.JPG|500px]] [[File:SMILE MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found on [https://github.com/Astroricks/Beagle-Project/tree/master/Miniproject02 Github:Astroricks].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-17T23:26:19Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Moravec&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Yue&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 0  No git&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    8&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
[[File:DOT MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FROWN MATRIX.JPG|500px]] [[File:SMILE MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found [https://github.com/Astroricks/Beagle-Project/tree/master/Miniproject02 here].&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T06:27:33Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
[[File:DOT MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FROWN MATRIX.JPG|500px]] [[File:SMILE MATRIX.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T06:26:06Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|500px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
[[File:DOT MATRIX.JPG]|500px]&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:FROWN MATRIX.JPG]|500px] [[File:SMILE MATRIX.JPG]|500px]&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and have fun!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/File:SMILE_MATRIX.JPG</id>
		<title>File:SMILE MATRIX.JPG</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/File:SMILE_MATRIX.JPG"/>
				<updated>2012-10-16T06:21:46Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: Smile face on the LED matrix.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Smile face on the LED matrix.&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/File:FROWN_MATRIX.JPG</id>
		<title>File:FROWN MATRIX.JPG</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/File:FROWN_MATRIX.JPG"/>
				<updated>2012-10-16T06:18:03Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: Frown face on the LED matrix.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Frown face on the LED matrix.&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/File:DOT_MATRIX.JPG</id>
		<title>File:DOT MATRIX.JPG</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/File:DOT_MATRIX.JPG"/>
				<updated>2012-10-16T06:14:08Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: A dot on the LED matrix.&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;A dot on the LED matrix.&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T06:11:13Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|600px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:56:36Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:56:17Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
&lt;br /&gt;
[[File:IMG wireup.JPG|400px]]&lt;br /&gt;
&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:55:41Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
[[File:IMG wireup.JPG|200px]]&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:54:24Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
[[File:IMG wireup.JPG]]&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:48:51Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
[[File:IMG wireup.jpg]]&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	<entry>
		<id>http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick</id>
		<title>Adafruit: 2-Axis Thumb Joystick</title>
		<link rel="alternate" type="text/html" href="http://www.elinux.org/Adafruit:_2-Axis_Thumb_Joystick"/>
				<updated>2012-10-16T05:47:55Z</updated>
		
		<summary type="html">&lt;p&gt;Astroricks: /* Control a 8x8 LED Matrix With The Joystick */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;[[Category:ECE497]] [[Category:Adafruit]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre style=&amp;quot;color:red&amp;quot;&amp;gt;&lt;br /&gt;
Overview: 2&lt;br /&gt;
Wiring:   2&lt;br /&gt;
Code:     2&lt;br /&gt;
git/Compiles with make: 2  gcc works&lt;br /&gt;
Demo:     2&lt;br /&gt;
Total:    10&lt;br /&gt;
Comments: Looks good.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
[[File:2axisthumbstick_MED.jpg]]&lt;br /&gt;
== Overview ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit: 2-Axis Thumb Joystick uses 2 10 k&amp;amp;Omega; pots which are adjusted by moving the joystick. The joystick and development board can be purchased from the [https://www.adafruit.com/products/512 Adafruit Website]. The joystick is simplistic enough that Adafruit does not provide a datasheet.&lt;br /&gt;
&lt;br /&gt;
From the Manufactorer:&lt;br /&gt;
''This mini-kit makes it easy to mount a PSP/Xbox-like thumb joystick to your project. The thumbstick is an analog joystick - more accurate and sensitive than just 'directional' joysticks - with a 'press in to select' button. Since it's analog, you'll need to analog reading pins on your microcontroller to determine X and Y. Having an extra digital input will let you read the switch. ''&lt;br /&gt;
&lt;br /&gt;
== Inputs and Outputs ==&lt;br /&gt;
&lt;br /&gt;
The Adafruit joystick takes a supply voltage (Vs) of up to 5V. The analog outputs have a direct correlation to the resistance observed by the analog joystick. At the resting position, the resistance in both axis is at its middle resistance or 5k. At either extreme of the range of motion, there is either enough resistance for the analog inputs to register a 0 or so little resistance that the supply line to the analog input looks open.&lt;br /&gt;
&lt;br /&gt;
== BeagleBone Usage ==&lt;br /&gt;
&lt;br /&gt;
The BeagleBone can support up to 8 analog inputs and has the ability to supply an analog 1.8 V voltage and an analog ground. I have connected my beagle as shown after soldering the joystick and some wires to the dev board:&lt;br /&gt;
&lt;br /&gt;
[[File:BeagleBone_Adafruit_2axis_Joystick_mmoravec.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The pinout is as shown:&lt;br /&gt;
&lt;br /&gt;
[[File:Bone_P9_pinout.jpg|300px]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Pins 36 and 38 I have wired to the 0-1.8V analog inputs. I have wired VCC to the Beagle's 1.8V analog VCC output(pin 32). The ground wire from the joystick is wired to the analog ground on the beagle(pin 34). The select GPIO signal I have routed to the GPIO_7 pin(pin 42).&lt;br /&gt;
&lt;br /&gt;
I have written a small program which displays the x-Axis and y-Axis positions in the terminal. It can be found in a git repository [http://github.com/mmoravec/Adafruit_Joystick_Utility here]. &lt;br /&gt;
&lt;br /&gt;
Using this configuration one can take the analog inputs with the GPIO selector and do about anything that requires two axises of movement and a selection knob. If you need some help interfacing with the analog ports or the GPIO ports, check out Dr. Yoder's succinct exercise at [http://elinux.org/EBC_Exercise_10_Flashing_an_LED Analog and GPIO Info]&lt;br /&gt;
&lt;br /&gt;
Enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Control a 8x8 LED Matrix With The Joystick ==&lt;br /&gt;
&lt;br /&gt;
Now we have the joystick as an input, and we can do something interesting if there's an output part. This is a mini project about using the joysick to control a 8x8 LED matrix.&lt;br /&gt;
&lt;br /&gt;
The details about the LED matrix can be found here: [https://www.adafruit.com/products/871 Mini 8x8 LED Matrix w/I2C - Yellow]&lt;br /&gt;
The LED matrix has an i2c port. Wire up the LED matrix to the Beagle Bone by attaching the Vdd to the 3.3V + bus, the GND to the - bus, SDA to SDA (pin 20), and SCLK to SCLK (pin 19). The joystick can be wired up as described above. Here is a picture of the hardware configuration.&lt;br /&gt;
[[File:IMG_wireup|thumb|Wire Up Picture]]&lt;br /&gt;
Our main goal is to create a bright dot on the LED matrix and use the joystick to move it.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
pos = 0x80;&lt;br /&gt;
&lt;br /&gt;
if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
	row ++;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row - 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
	row --;&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
	dot_bmp[row + 1] = 0x00;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
	pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
	pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
	dot_bmp[row] = pos;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
This is how we move the dot around: First, we create a bmp array whose first element is 0x80, which means only the dot on the right-down corner should be bright. 'analog_value_x' and 'analogy_value_y' are the two variables we set up to represent the voltage of x-axis and y-axis analog-in. 'pos' represents the position of the bright dot in the row. If 'analog_value_x' changes significantly and the bright dot does not reach the boundary of the 8x8 matrix, we should light up the dot next to it and turn off the dot itself.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
	block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
For some reason the display is rotated one column, so after pre-unrotating the data, we can write the block data through the i2c bus. Thus, a dot can be lighten up on the matrix and can be moved as the way we want.&lt;br /&gt;
&lt;br /&gt;
Next, we would like to make use of the button on the joystick. This is our objective: when pushing the button down, an interrupt is triggered and a frown face is presented on the LED matrix. Then if we move the dot across the face, it can be changed to a smile face.&lt;br /&gt;
&lt;br /&gt;
According to the instructions on the joystick, the SEL shorts to ground when pressed. So the first important thing to do is to change gpio0_7 to pull-up mode. So that the interrupt can work correctly. Instructions about setting the interrupt can be found [http://elinux.org/EBC_Exercise_11_gpio_Polling_and_Interrupts here].&lt;br /&gt;
&lt;br /&gt;
In the interrupt, we set the smile face as the 'hidden_bmp', the frown_face as the 'bright_bmp', and set up a 'trace_bmp' to record the LEDs that the dot has passed. The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself. &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
We've reached our goal! Try to change the graphs and enjoy!&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The main code are listed as below. And all the resources including the header files can be found here.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/*****************************************************&lt;br /&gt;
Project Name: Joystick controlled 8x8 LED Matrix&lt;br /&gt;
Author: Yue Zhang&lt;br /&gt;
Date: 10/10/2012&lt;br /&gt;
*****************************************************/&lt;br /&gt;
&lt;br /&gt;
#include &amp;lt;errno.h&amp;gt;&lt;br /&gt;
#include &amp;lt;string.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdio.h&amp;gt;&lt;br /&gt;
#include &amp;lt;stdlib.h&amp;gt;&lt;br /&gt;
#include &amp;lt;unistd.h&amp;gt;&lt;br /&gt;
#include &amp;lt;fcntl.h&amp;gt;&lt;br /&gt;
#include &amp;lt;poll.h&amp;gt;&lt;br /&gt;
#include &amp;lt;signal.h&amp;gt;	// Defines signal-handling functions (i.e. trap Ctrl-C)&lt;br /&gt;
#include &amp;quot;i2c-dev.h&amp;quot;&lt;br /&gt;
#include &amp;quot;i2cbusses.h&amp;quot;&lt;br /&gt;
#include &amp;quot;gpio.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Constants&lt;br /&gt;
****************************************************************/&lt;br /&gt;
 &lt;br /&gt;
#define SYSFS_GPIO_DIR &amp;quot;/sys/class/gpio&amp;quot;&lt;br /&gt;
#define POLL_TIMEOUT (100) /* 0.1 seconds */&lt;br /&gt;
#define MAX_BUF 64&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * Global variables&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
int keepgoing = 1;	// Set to 0 when ctrl-c is pressed&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
 * signal_handler&lt;br /&gt;
 ****************************************************************/&lt;br /&gt;
// Callback called when SIGINT is sent to the process (Ctrl-C)&lt;br /&gt;
void signal_handler(int sig)&lt;br /&gt;
{&lt;br /&gt;
	printf( &amp;quot;Ctrl-C pressed, cleaning up and exiting..\n&amp;quot; );&lt;br /&gt;
	keepgoing = 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* analog_in&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int analog_in(char *ain)&lt;br /&gt;
{&lt;br /&gt;
	FILE *fp;&lt;br /&gt;
	char ainPath[MAX_BUF];&lt;br /&gt;
	char ainVal[MAX_BUF];&lt;br /&gt;
	&lt;br /&gt;
	snprintf(ainPath, sizeof ainPath, &amp;quot;/sys/devices/platform/omap/tsc/%s&amp;quot;, ain);&lt;br /&gt;
&lt;br /&gt;
	if((fp = fopen(ainPath, &amp;quot;r&amp;quot;)) == NULL){&lt;br /&gt;
	printf(&amp;quot;Can't open this pin, %s\n&amp;quot;, ain);&lt;br /&gt;
	return 1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	fgets(ainVal, MAX_BUF, fp);&lt;br /&gt;
&lt;br /&gt;
	fclose(fp);&lt;br /&gt;
	return atoi(ainVal);		&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Check&lt;br /&gt;
****************************************************************/&lt;br /&gt;
static void help(void) __attribute__ ((noreturn));&lt;br /&gt;
&lt;br /&gt;
static void help(void)&lt;br /&gt;
{&lt;br /&gt;
	fprintf(stderr, &amp;quot;Usage: my2cset (hardwired to bus 3, address 0x70)\n&amp;quot;);&lt;br /&gt;
	exit(1);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
static int check_funcs(int file, int size)&lt;br /&gt;
{&lt;br /&gt;
	unsigned long funcs;&lt;br /&gt;
&lt;br /&gt;
	/* check adapter functionality */&lt;br /&gt;
	if (ioctl(file, I2C_FUNCS, &amp;amp;funcs) &amp;lt; 0) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Could not get the adapter &amp;quot;&lt;br /&gt;
			&amp;quot;functionality matrix: %s\n&amp;quot;, strerror(errno));&lt;br /&gt;
		return -1;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	switch (size) {&lt;br /&gt;
	case I2C_SMBUS_BYTE:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus send byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BYTE_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BYTE_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write byte&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_WORD_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_WORD_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus write word&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
&lt;br /&gt;
	case I2C_SMBUS_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_BLOCK_DATA)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;SMBus block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	case I2C_SMBUS_I2C_BLOCK_DATA:&lt;br /&gt;
		if (!(funcs &amp;amp; I2C_FUNC_SMBUS_WRITE_I2C_BLOCK)) {&lt;br /&gt;
			fprintf(stderr, MISSING_FUNC_FMT, &amp;quot;I2C block write&amp;quot;);&lt;br /&gt;
			return -1;&lt;br /&gt;
		}&lt;br /&gt;
		break;&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
/****************************************************************&lt;br /&gt;
* Main&lt;br /&gt;
****************************************************************/&lt;br /&gt;
int main(int argc, char *argv[])&lt;br /&gt;
{&lt;br /&gt;
	struct pollfd fdset[1];&lt;br /&gt;
	int nfds = 1;&lt;br /&gt;
	int gpio_button_fd, ain_pin_x, ain_pin_y, timeout;&lt;br /&gt;
	char *buf[MAX_BUF];&lt;br /&gt;
	char ainx[MAX_BUF], ainy[MAX_BUF];&lt;br /&gt;
	unsigned int gpio_button;&lt;br /&gt;
	float analog_value_x = 0, analog_value_y = 0;&lt;br /&gt;
	int res, i2cbus, address, size, file;&lt;br /&gt;
	int value, daddress;&lt;br /&gt;
	char filename[20];&lt;br /&gt;
	int force = 0, readback = 1;&lt;br /&gt;
	__u16 block[I2C_SMBUS_BLOCK_MAX], hidden_bmp[I2C_SMBUS_BLOCK_MAX], bright_bmp[I2C_SMBUS_BLOCK_MAX], trace_bmp[I2C_SMBUS_BLOCK_MAX];&lt;br /&gt;
	int row = 0, pos = 0x80;&lt;br /&gt;
	int i, n = 0;&lt;br /&gt;
	&lt;br /&gt;
	static __u16 dot_bmp[] = {0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};&lt;br /&gt;
	static __u16 smile_bmp[] = {0x3C, 0x42, 0x95, 0xA1, 0xA1, 0x95, 0x42, 0x3C};&lt;br /&gt;
	static __u16 frown_bmp[] = {0x3C, 0x42, 0xA5, 0x91, 0x91, 0xA5, 0x42, 0x3C};&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	// Set the signal callback for Ctrl-C&lt;br /&gt;
	signal(SIGINT, signal_handler);&lt;br /&gt;
	&lt;br /&gt;
	// Get the pin values&lt;br /&gt;
	gpio_button = 7;&lt;br /&gt;
	ain_pin_x = 6;&lt;br /&gt;
	ain_pin_y = 4;&lt;br /&gt;
&lt;br /&gt;
	// Set gpio0_7 to be pullup&lt;br /&gt;
	gpio_pullup();&lt;br /&gt;
&lt;br /&gt;
	// Set the gpio_button to be input and set its working pattern	&lt;br /&gt;
	gpio_export(gpio_button);&lt;br /&gt;
	gpio_set_dir(gpio_button, 0);&lt;br /&gt;
	gpio_set_edge(gpio_button, &amp;quot;falling&amp;quot;);  // Can be rising, falling or both&lt;br /&gt;
	gpio_button_fd = gpio_fd_open(gpio_button);&lt;br /&gt;
&lt;br /&gt;
	// Set up analog-in&lt;br /&gt;
	snprintf(ainx, sizeof ainx, &amp;quot;ain%d&amp;quot;, ain_pin_x);&lt;br /&gt;
	snprintf(ainy, sizeof ainy, &amp;quot;ain%d&amp;quot;, ain_pin_y);&lt;br /&gt;
 &lt;br /&gt;
	// Set time out&lt;br /&gt;
	timeout = POLL_TIMEOUT;&lt;br /&gt;
 &lt;br /&gt;
	// Set up i2c&lt;br /&gt;
	i2cbus = lookup_i2c_bus(&amp;quot;3&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;i2cbus = %d\n&amp;quot;, i2cbus);&lt;br /&gt;
	if (i2cbus &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	address = parse_i2c_address(&amp;quot;0x70&amp;quot;);&lt;br /&gt;
	printf(&amp;quot;address = 0x%2x\n&amp;quot;, address);&lt;br /&gt;
	if (address &amp;lt; 0)&lt;br /&gt;
		help();&lt;br /&gt;
&lt;br /&gt;
	size = I2C_SMBUS_BYTE;&lt;br /&gt;
&lt;br /&gt;
	daddress = 0x21;&lt;br /&gt;
	if (daddress &amp;lt; 0 || daddress &amp;gt; 0xff) {&lt;br /&gt;
		fprintf(stderr, &amp;quot;Error: Data address invalid!\n&amp;quot;);&lt;br /&gt;
		help();&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	file = open_i2c_dev(i2cbus, filename, sizeof(filename), 0);&lt;br /&gt;
	printf(&amp;quot;file = %d\n&amp;quot;, file);&lt;br /&gt;
	if (file &amp;lt; 0&lt;br /&gt;
	 || check_funcs(file, size)&lt;br /&gt;
	 || set_slave_addr(file, address, force))&lt;br /&gt;
		exit(1);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x21;	// Start oscillator&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x81;	// Display on, blinking off&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		daddress = 0xe7;	// Full brightness&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
		daddress = 0x00;	// Start writing to address 0&lt;br /&gt;
		printf(&amp;quot;writing: 0x%02x\n&amp;quot;, daddress);&lt;br /&gt;
		res = i2c_smbus_write_byte(file, daddress);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	while (keepgoing) {&lt;br /&gt;
		memset((void*)fdset, 0, sizeof(fdset));&lt;br /&gt;
&lt;br /&gt;
		fdset[0].fd = gpio_button_fd;&lt;br /&gt;
		fdset[0].events = POLLPRI;&lt;br /&gt;
&lt;br /&gt;
		analog_value_x = analog_in(ainx);&lt;br /&gt;
		analog_value_y = analog_in(ainy);&lt;br /&gt;
&lt;br /&gt;
		&lt;br /&gt;
		poll(fdset, nfds, timeout);		&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		if(analog_value_x &amp;gt;= 4000 &amp;amp;&amp;amp; row &amp;lt; 7) {&lt;br /&gt;
			row ++;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row - 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_x &amp;lt;= 1000 &amp;amp;&amp;amp; row &amp;gt; 0) {&lt;br /&gt;
			row --;&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
			dot_bmp[row + 1] = 0x00;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;gt;= 4000 &amp;amp;&amp;amp; pos &amp;lt; 0x80) {&lt;br /&gt;
			pos = pos &amp;lt;&amp;lt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		if(analog_value_y &amp;lt;= 1000 &amp;amp;&amp;amp; pos &amp;gt; 0x01) {&lt;br /&gt;
			pos = pos &amp;gt;&amp;gt; 1;			&lt;br /&gt;
			dot_bmp[row] = pos;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
		// The LEDs we should light up is the LEDs in the bright_bmp that the dot hasn't passed, the LEDs in the hidden_bmp that the dot has already passed, and the dot itself.  &lt;br /&gt;
		trace_bmp[row] = trace_bmp[row] | dot_bmp[row];&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)		&lt;br /&gt;
			bright_bmp[i] = (bright_bmp[i] &amp;amp; ~trace_bmp[i]) | (hidden_bmp[i] &amp;amp; trace_bmp[i]) | dot_bmp[i];&lt;br /&gt;
&lt;br /&gt;
		// For some reason the display is rotated one column, so pre-unrotate the data.&lt;br /&gt;
		for(i = 0; i &amp;lt; 8; i ++)&lt;br /&gt;
			block[i] = (bright_bmp[i] &amp;amp; 0xfe) &amp;gt;&amp;gt;1 | (bright_bmp[i] &amp;amp; 0x01) &amp;lt;&amp;lt; 7;&lt;br /&gt;
&lt;br /&gt;
		res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
		// Button interrupt&lt;br /&gt;
		if (fdset[0].revents &amp;amp; POLLPRI) {&lt;br /&gt;
			lseek(fdset[0].fd, 0, SEEK_SET);  // Read from the start of the file&lt;br /&gt;
			read(fdset[0].fd, buf, MAX_BUF);						&lt;br /&gt;
			switch(n){&lt;br /&gt;
				case(0):		// Initialize in the initial interrupt.&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = 0x00;&lt;br /&gt;
						bright_bmp[i] = 0x00;&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	 &lt;br /&gt;
					break;		&lt;br /&gt;
				default:&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) &lt;br /&gt;
						block[i] = (frown_bmp[i]&amp;amp;0xfe) &amp;gt;&amp;gt;1 | (frown_bmp[i]&amp;amp;0x01) &amp;lt;&amp;lt; 7;					&lt;br /&gt;
					res = i2c_smbus_write_i2c_block_data(file, daddress, 16, (__u8 *)block);&lt;br /&gt;
					sleep(1);&lt;br /&gt;
					for(i = 0; i &amp;lt; 8; i ++) {&lt;br /&gt;
						hidden_bmp[i] = smile_bmp[i];&lt;br /&gt;
						bright_bmp[i] = frown_bmp[i];&lt;br /&gt;
						trace_bmp[i] = 0x00;&lt;br /&gt;
					}	&lt;br /&gt;
					break;&lt;br /&gt;
			}			&lt;br /&gt;
			n++;&lt;br /&gt;
		}&lt;br /&gt;
		&lt;br /&gt;
&lt;br /&gt;
		fflush(stdout);&lt;br /&gt;
	}&lt;br /&gt;
&lt;br /&gt;
	gpio_fd_close(gpio_button_fd);&lt;br /&gt;
	return 0;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
	exit(0);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Astroricks</name></author>	</entry>

	</feed>