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 01:30] – [HAH and the Arduino] 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 / | ||
Line 53: | Line 53: | ||
{{: | {{: | ||
- | <note important> | + | <note important> |
Tested with v18 of the IDE | Tested with v18 of the IDE | ||
Line 59: | 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 188: | Line 188: | ||
</ | </ | ||
- | Step 2. Plug your arduino | + | Step 2. Plug your Arduino |
< | < | ||
# dmesg | # dmesg | ||
Line 196: | 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 251: | 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 270: | Line 275: | ||
} | } | ||
</ | </ | ||
- | |||
====== Arduino links ====== | ====== Arduino links ====== | ||