Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
livebox:hah_arduino [2012/03/04 00:48] – [Programming the Arduino from the HAH] brett | livebox:hah_arduino [2012/05/14 21:31] (current) – [LED control with a BSC schema] minerva9 | ||
---|---|---|---|
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 | ||
</ | </ | ||
Line 21: | Line 23: | ||
====== Programming the Arduino from the HAH ====== | ====== Programming the Arduino from the HAH ====== | ||
- | Arduino's before the UNO | + | Arduino: Duemilanove |
< | < | ||
# stty -F / | # stty -F / | ||
Line 27: | Line 29: | ||
</ | </ | ||
- | The Arduino UNO uses an ACM driver. | + | Arduino: UNO |
< | < | ||
# stty -F / | # stty -F / | ||
Line 51: | Line 53: | ||
{{: | {{: | ||
- | <note important> | + | <note important> |
Tested with v18 of the IDE | Tested with v18 of the IDE | ||
Line 57: | 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 186: | Line 188: | ||
</ | </ | ||
- | Step 2. Plug your arduino | + | Step 2. Plug your Arduino |
< | < | ||
# dmesg | # dmesg | ||
Line 194: | 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 249: | 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 a new message directly. You need to open any arbitrary message, edit it and then press ' | ||
- | Step 5. Send a BSC control message to our endpoint and turn the LED on/off ! | ||
< | < | ||
xap-header | xap-header | ||
Line 268: | Line 275: | ||
} | } | ||
</ | </ | ||
- | |||
====== Arduino links ====== | ====== Arduino links ====== | ||