Differences
This shows you the differences between two versions of the page.
Next revision | Previous revisionLast revisionBoth sides next revision | ||
livebox:hah_arduino [2011/10/10 17:49] – external edit 127.0.0.1 | livebox:hah_arduino [2012/05/14 20:04] – [LED control with a BSC schema] brett | ||
---|---|---|---|
Line 9: | Line 9: | ||
* Arduino Ethernet (with a shield) | * Arduino Ethernet (with a shield) | ||
- | All can be interfaced with the HAH unit. | + | All can be interfaced with the HAH unit. Depending on your existing knowledge of things like FTP/the vi editor/unix style operating systems/the Lua scripting language, it might take you a little time to read up on these topics. However, the examples and support library code have been designed to help you along. |
+ | |||
+ | Once a USB Arduino is connected it will be presented as a / | ||
- | Once a USB Arduino is connected it will be presented as a / | ||
< | < | ||
- | # dmesg | tail | + | / |
usbserial.c: | usbserial.c: | ||
usbserial.c: | usbserial.c: | ||
+ | ttyACM0: USB ACM device | ||
+ | </ | ||
+ | |||
+ | |||
+ | ====== Programming the Arduino from the HAH ====== | ||
+ | |||
+ | Arduino: Duemilanove | ||
+ | < | ||
+ | # stty -F / | ||
+ | # avrdude -v -c arduino -p m328p -P / | ||
+ | </ | ||
+ | |||
+ | Arduino: UNO | ||
+ | < | ||
+ | # stty -F / | ||
+ | # avrdude -v -c arduino -p m328p -P / | ||
</ | </ | ||
Line 36: | Line 53: | ||
{{: | {{: | ||
- | <note important> | + | <note important> |
Tested with v18 of the IDE | Tested with v18 of the IDE | ||
Line 42: | Line 59: | ||
====== Ethernet xAP Arduino Library ====== | ====== Ethernet xAP Arduino Library ====== | ||
- | To aid writing xAP compliant applications for the Arduino an xAP processing library has been written. | + | To aid writing xAP compliant applications for the Arduino, an xAP processing library has been written. |
These are the classes exposed by the library. | These are the classes exposed by the library. | ||
Line 171: | Line 188: | ||
</ | </ | ||
- | Step 2. Plug your arduino | + | Step 2. Plug your Arduino |
< | < | ||
# dmesg | # dmesg | ||
Line 179: | Line 196: | ||
In this case we are using / | In this case we are using / | ||
- | Step 3. Now we will create a LUA [[hah_plugboard_v2|plugboard]] applet and a BSC endpoint so this LED can be easily controlled. | + | Step 3. Now we will create a Lua [[hah_plugboard_v2|plugboard]] applet and a BSC endpoint so this LED can be easily controlled. |
+ | |||
+ | Like all Plugboard scripts, this must be placed in the / | ||
<code lua> | <code lua> | ||
Line 234: | Line 253: | ||
</ | </ | ||
- | Step 4. Restart the plugboard daemon make sure the new Applet is loaded | + | Step 4. Restart the plugboard daemon |
+ | |||
+ | Step 5. Send a BSC control message to our endpoint and turn the LED on/off. An easy way to send BSC control messages and to view the new LED endpoint itself is to use [[http:// | ||
+ | |||
+ | <note tip>With xFx Viewer you can't send directly you need to open any arbitrary message, edit it and then press send.</ | ||
- | Step 5. Send a BSC control message to our endpoint and turn the LED on/off ! | ||
< | < | ||
xap-header | xap-header | ||
Line 253: | Line 275: | ||
} | } | ||
</ | </ | ||
- | |||
====== Arduino links ====== | ====== Arduino links ====== | ||