Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.
mperkel:
Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.
Use the bridge Lukemperkel... ![]()
Ok, a bit more seriously, you need to understand the concurrent nature of the Yun's two processors.
You have SSH only on the MIPS/Linux side and any I/O pins are only accessible on the AVR/Leonardo side...
So to communicate from one side to the other, you have to use the "bridge", which is a software library on either side to exchange data over the internal serial connection, which is the only hardware that connects between the two parts.
So on the Linux side, you need to use a Python/Lua/C(++) program to accept your "command" and send it via the bridge to a sketch on the Leonardo side, which then toggles the LED via I/O pin...
Ralf
mperkel:
Just wondering - how do I control pin 13 on and off from the command line? I want to SSH in - type a command and turn the LED on and off.
If you want to just play with the LEDs, there is more than pin 13. My notes are at the link below. I just made some minor updates to clarify what you are looking for.
FYI: You canNOT control pin 13 directly from the command line. You'll have to write a special script to do that, just as PCWorxLA is alluding to. More information in my notes.
Arduino Yun LEDs
http://codesnippets.altervista.org/documentation/yun/leds/leds.html
Jesse
ok - thanks. That explains why I can't find how to do it.
If you have to go through AVR path;-
Arduino IDE, File->Examples->Bridge->Bridge upload it to Yun.
turn on LED:
/usr/bin/curl "http://127.0.0.1/arduino/digital/13/1"
turn off LED:
/usr/bin/curl "http://127.0.0.1/arduino/digital/13/0"
http://forum.arduino.cc/index.php?topic=288769.msg2021847#msg2021847
Since you are at MIPS/Linux side, jessemonroy650's way is the way to go.