・Set up Raspberry Pi Noobs
・Install wiringPi
・GPIO setting for Python.(Python is the simplest sample code,.You don't need to check the number of GPIO. )
・Web controller with PHP for MCU Gear
Step 1: Install
Type these command on your Pi's terminal.
$sudo apt-get install git-core
$sudo apt-get update
$sudo apt-get upgrade
$git clone git://git.drogon.net/wiringPi
$cd wiringPi
$git pull origin
$./build
test operation after build
$gpio -v
$gpio readall
You can see all IO setting like a picture.
Then reboot.
$sudo reboot
Step 2 : Download sample files, and compile.
$cd /home/pi/Desktop/
$wget http://www.mcugear.org/RPitest/MCUGearRPwp.tar
$tar xvf MCUGearRPwp.tar
$wget http://www.mcugear.org/RPitest/MCUGearRPwp.tar
$tar xvf MCUGearRPwp.tar
Connect MCU Gear to Raspberry Pi and turn on.
You always need type these command for using I2C and SPI.
$gpio load i2c 1000
$gpio load spi
Move directry.
$cd MCUGearRPwp
Compile it.
$g++ -Wall -o main main.c MCUGear.cpp MCUGearBase.cpp -lwiringPi
(MCU Gear sample program is C++ but main.c is C language.)
Step 3 : My favorite C & C++ editor is geany, It is very easy to use.
$sudo apt-get install geany
! Option function is little bit difficult. You need to change sample program. (bank parameters)

0 件のコメント:
コメントを投稿