This document provides information about a workshop on FIO (Funnel I/O), which is a hardware and software platform that allows physical computing using Arduino, XBee radio modules, and the Funnel programming environment. The workshop agenda includes primers on Arduino, XBee radios, and using the Funnel visual programming interface. Participants will learn how to connect Arduino-based sensors and actuators over XBee radios and control them remotely from a PC using Funnel. The document lists the required materials and provides code examples for basic input/output tasks with FIO.
76. Gainer
1
var lastState = -1; //
var t = 127; //
var h = 20; //
var gio = new Gainer();
function loop():void {
var state = lastState;
var val = gio.analogInput[0]; // 0
if (val < (t - h)) //
state = 0; // 0
else if (val > (t + h)) //
state = 1; // 1
if (lastState == 0 && state == 1) // 0 1
sound.start(); //
lastState = state; //
}
77. Funnel
2
var gio = new Gainer();
//
gio.addFilter(new SetPoint(0.5, 0.1));
//
gio.addEventListener(RISING_EDGE, onButtonPress);
//
function onButtonPress(e:Event):void {
sound.start(); //
}
95. Arduino LED
4 Arduino LED
int ledPin = 13;
void setup() {
pinMode(ledPin, OUTPUT);
}
void loop() {
digitalWrite(ledPin, HIGH);
delay(1000);
digitalWrite(ledPin, LOW);
delay(1000);
}
96. C LED
5 C LED
#include <avr/io.h>
#include <avr/pgmspace.h>
#include <avr/delay.h>
#define CLK_CALIB_DATA (FLASHEND - 3)
void init() {
uint8_t osccal_data = pgm_read_byte(CLK_CALIB_DATA);
if (osccal_data != 0xff) OSCCAL = osccal_data;
DDRB = 0xff;
DDRD = 0xff;
return;
}
97. C LED
6 C LED
void delay_ms(uint16_t t) {
while (t--) _delay_ms(1);
}
int main(void) {
init();
for (; ;) {
PORTB = 0xff;
delay_ms(500);
PORTB = 0x00;
delay_ms(500);
}
return 0;
}
101. Firmata PC
• Pd (aka Pure Data)
• Processing
• Funnel
• Linux C++
• C++/openFrameworks
102. 10G
IEEE 802.11n
100M
IEEE 802.11a/g
10M IEEE 802.11b
Bluetooth
1M
ANT
100k
ZigBee/IEEE 802.15.4
10k
1k
0.1m 1m 10m 100m 1km
BAN PAN LAN MAN
103. Wi-Fi Bluetooth 802.15.4/ZigBee
IEEE 802.11a/b/g/n 802.15.1 802.15.4
2.4GHz/5GHz 2.4GHz 866MHz/915MHz/2.4GHz
100m 100m 100m 2.4GHz
300Mbps 3Mbps 250kbps 2.4GHz
32 7 65535
LAN
1
110. XBee
XBee
• hardware/fio/tool/XBeeConfigTool
•
• PAN ID
•
• MY ID
• Configure
111. FIO
• XBee Explorer USB PC
• Arduino 17
• Tools Board Arduino Pro/ Pro Mini
(8MHz) w/ ATmega168
• Tools Serial Port
• Open Examples Digital Blink
• Upload to I/O Board