您的位置:首页 > 编程语言 > Python开发

Programming python to make BeagleBone on board LED'd blink

2012-05-01 09:56 344 查看
I'm on a Ubuntu Linux 11.10 so I used the following command:

screen /dev/`dmesg | grep FTDI | grep "now attached to" | tail -n 1 | awk '{ print $NF }'` 115200

Your terminal should show a Logo of Angstrom and then a login screen. Just type in "root" and press enter.

Now we should see a screen that displays this:

root@beaglebone:

So lets download our Blinking python script by typing in the following

wget http://pastebin.com/raw.php?i=US7UaD31
[wait for the file to download]

then we want to rename the file from raw.php?i=US7UaD31 to an easier to type name so lets to the following to rename the file

mv raw.php?i=US7UaD31 led-blink.py

now we have the filename renamed to what we want lets run it! (The fun part)

python led-blink.py

The python should be running infitely blinking on and off on the led beaglebone onboard LEDs

Thats it!!

To stop the python script from running any more go to the BeagleBone terminal and press Ctrl+C to stop the program. If its gridlocked you can do Ctrl+A then press Z
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐