12. (2)

使Ubicomp
aka IoT
Web

IoT
by

Google

Google

Google

Google
Ubicomp!

Ubicomp
Web

Web

(2014)
?

Phidgets, Arduino, mbed...
XBee, WiPort, ...

Phidgets
USB

Arduino
USB/Serial + AVR
Processing

Arduino Micro

Arduino + Bluetooth

LilyPad
Arduino

LilyPad

mbed
Web

XBee
ZigBee

WiPort
LAN+CPU+

Sun SPOT
Java
83LED

IOIO
Android ADK
Android (c.f. Phidgets)

Harpy
Android ADK+Arduino

Raspberry Pi
ARM
Linux使

Intel Galileo
Linux + Arduino

Intel Edison

JavaScript
Processing

=
//
e.g.
Human enhancement


/
e.g.

UbiComp

Poor Man's UbiComp (PMUC)
使
× 3
使
× HMD
使
GPSUSB

PMUC
LAN, etc.
/

PMUC
LAN, etc.
/
!


()

()
()
DVD

?

?
Wifi
KB

on/off
DVD
////
...

CD
CD

CDCD
CD-ROM/!



使
使

Invisible Computer

PMUC
使

(etc.)
(etc.)

GUI
(GUI)
/...
FieldMouse, MouseField使


FieldMouse
ID +
使
Active
Active Hardcopy (Web)
Real-World GUI

使


FieldMouse使GUI
GUI使
==

: FieldMouse

MouseField
RFID

MouseField使
/

MouseField

MouseField

PlayStand++

PlayStand++

: PlayStand

GoldFish
AndroidGUI
NFCJS
JavaScript
Web

: GoldFish

GoldFish
GoldFish
+
GoldFish
JavaScript
URL

GoldFish
NFC
URL
JavaScript


GoldFish
http://ubif.org/(ID)
TinyURL, Bit.ly

1:

2:

3:

:



Goldfish
調
Wifi or

Goldfish

使

使
c.f.
3

7
TV
4便

( = )
()

Phidgets

Phidgets
import Phidgets.*;
public class IFKex1 extends _IPhidgetInterfaceKitEventsAdapter
{
public void OnSensorChange(_IPhidgetInterfaceKitEvents_OnSensorChangeEvent ke) {
System.out.println("SensorChange: " + ke.get_SensorValue());
}
public void OnInputChange(_IPhidgetInterfaceKitEvents_OnInputChangeEvent ke) {
System.out.println("InputChange: " + ke.get_Index() + " " + ke.get_NewState());
}
public void OnDetach(_IPhidgetInterfaceKitEvents_OnDetachEvent ke) {
System.out.println("FINISHED!");
}
public static void main(String[] args) {
new IFKex1();
}
public IFKex1()
{
PhidgetInterfaceKit phid = new PhidgetInterfaceKit();
phid.add_IPhidgetInterfaceKitEventsListener(this);
if (phid.Open(false) == false)
{
System.out.println("Could not find a PhidgetInterfaceKit");
return;
}
System.out.println(phid.GetDeviceType());
System.out.println("Serial Number " + phid.GetSerialNumber());
System.out.println("Device Version " + phid.GetDeviceVersion());
phid.SetSensorChangeTrigger(7, 1);
phid.start();
System.out.println("Looping...\n");
for(int i = 0; i < 1000; ++i)
{
phid.SetOutputState(0,true);
}
// Turn the output on, and rudely leave it turned on!
phid.Close();
System.out.println("Closed and exitting...");
}
}

Phidgets
C, Java
使
Phidgets

Phidgets Server
PhidgetsTCP/IP
/
by @

MobiServer
Phidgets, X10, KURO-RS, XBee
by @

in Ruby
require "socket"
require "delicious"
PORT = 4321
HOST = "phidget.server.host"
USER = "masui"
server = TCPSocket.open(HOST,PORT)
while true
s = server.gets
break if s.nil?
a = s.split(/,/)
if a[1] == 'Weight' then
weight = a[2].to_f
if weight > 4.0 then
register(USER)
end
end
end

in Ruby
#!/usr/bin/env ruby
require "socket"
require "dl/import"
module Win32
extend DL::Importable
typealias "DWORD", "unsigned long"
typealias "BYTE", "unsigned char"
typealias "ULONG", "unsigned long"
KEYEVENTF_KEYUP = 0x02
VK_SHIFT = 0x10
VK_A = 0x41
VK_SPACE = 0x20
VK_BACKSPACE = 0x08
dlload "user32.dll"
extern "void keybd_event(BYTE, BYTE, DWORD, ULONG)"
def send_keybd_event(bVk, dwFlags = 0)
keybd_event(bVk, 0, dwFlags,0)
end
module_function :send_keybd_event
end
serverhost = 'localhost'
port = 4321
socket = TCPSocket.new(serverhost, port)
prevval0 = 0
prevval2 = 0
while line = socket.gets
(io,device,ad,portno,val) = line.chomp.split(/,/)
if io == 'In' && device == 'InterfaceKit' &&
ad = 'Analog' && portno.to_i == 0 then
if val.to_i > 100 && prevval0 < 100 then
Win32.send_keybd_event(Win32::VK_SPACE)
Win32.send_keybd_event(Win32::VK_SPACE,
Win32::KEYEVENTF_KEYUP)
end
prevval0 = val.to_i
end
...

Phidgets Server

Linda

Linda
Phidgets
X10

Linda
PCPhidgets
?
7

Rinda
RubyLinda
by
RubyLinda
× Ruby使

Rinda
require 'rinda/rinda'
require 'delicious'
TS_URI = 'druby://localhost:12345'
USER = 'masui'
ts = DRbObject.new(nil,TS_URI) #
while true
ts.write(['weight',$$,""]) #
val = ts.take(['weight',$$,Float])[2]
register(USER) if val > 4.0
end

Web-Linda
Gyazo

, , ...
, , ...
, , ...

(1)

(2)

(3)
使
調

(4)
BGM
....

BASIC
!

I/F
ID

ID
Wearable Computer

ID
ID?
?

...

/I/F
...
Programming by Example

AR
KAGE

KAGE

Kobito