SoCKit User Manual
83
www.terasic.com
December 1, 2015
Demonstration Source Code
Build tool: Altera SoC EDS v13.1
Project directory: \Demonstration\SoC\hps_gsensor
Binary file: gsensor
Build command: make ('make clean' to remove all temporal files)
Execute command: ./gsensor [loop count]
Demonstration Setup
Make sure BOOTSEL[2:0] = 101 (Boot from SD card)
Make sure CLKSEL[1:0] = 00
Make sure MSEL[4:0] = 00001
Connect the USB cable to the USB-to-UART connector (J4) on the SoCKit board and host PC.
Make sure the executable file "
gsensor
" is copied into the SD card under the "
/home/root
"
folder in Linux.
Insert the booting micro sdcard into the SoCKit board.
Power on the SoCKit board.
Launch PuTTY to connect to the UART port of SoCKit borad and type "
root
" to login Yocto
Linux.
In the UART terminal of PuTTY,, execute "
./gsensor
" to start the gsensor polling.
The demo program will show the X, Y, and Z values in the Putty, as shown in
Figure 6-10
.
Press "CTRL + C" to terminate the program.
Figure 6-10 Terminal output of the G-sensor Demonstration