Procedure to Autostart the Arduino Sketch on Edison
https://software.intel.com/en-us/blogs/2015/08/01/procedure-to-autostart-the-arduino-sketch-on-edison-0Based on the intel developer Zone.
Step 1.
If there is not init.d in the Intel Edison,
root@edison:~# mkdir /etc/init.d
If there is init.d in the Intel Edison,
root@edison:~# cd /etc/init.d
Step 2.
Create the file "automateSketch.sh" in the init.d using "vi" command.
root@edison:/etc/init.d# vi automateSketch.sh
Step 3.
Add the follow script: ( this script is executed every time linux boots)
#!/bin/sh
sleep 10
exec /sketch/sketch.elf /dev/ttyGS0 /dev/ttyGS0
echo 214 > /sys/class/gpio/export
echo 242 > /sys/class/gpio/export
echo 263 > /sys/class/gpio/export
echo low > /sys/class/gpio/gpio214/direction
echo low > /sys/class/gpio/gpio263/direction
echo out> /sys/class/gpio/gpio242/direction
echo high> /sys/class/gpio/gpio214/direction
Zumo uses PWM 10 pin to control the right side motor.

change the Jumper in J12 like the picture.
Add "echo" code for the PWM setting in the linux.
More detail information about Multipliexing Guide:
Intel® Edison GPIO Pin Multiplexing Guide
http://www.emutexlabs.com/project/215-intel-edison-gpio-pin-multiplexing-guideStep 4.
Permission setting:
root@edison:/etc/init.d# chmod +x /etc/init.d/automateSketch.sh
root@edison:/etc/init.d# chmod +x automateSketch.sh
Step 5.
Adding system startup for /etc/init.d/automateSketch.sh
root@edison:/etc/init.d# update-rc.d automateSketch.sh defaults







No comments:
Post a Comment