Open main menu
Home
Random
Log in
Settings
About Sugar Labs
Disclaimers
Sugar Labs
Search
Changes
← Older edit
Newer edit →
Activities/Turtle Art/Programmable Brick
(view source)
Revision as of 20:26, 29 August 2011
197 bytes added
,
20:26, 29 August 2011
→Device I/O
Line 204:
Line 204:
tw.lc.heap.append(-1)
tw.lc.heap.append(-1)
−
Look in /sys/devices on your computer to find other devices you may be able to access.
+
Look in /sys/devices on your computer to find other devices you may be able to access.
−
Also you
can access the following events on the X0-1.75, (some on X0-1.0 -1.5)
+
You can use the od (octal dump) command to inspect these events, eg
+
sudo od /dev/input/event0
+
+
You
can access the following events on the X0-1.75, (some on X0-1.0 -1.5)
* accelerometer: /dev/input/event0 ???
* accelerometer: /dev/input/event0 ???
* power button: /dev/input/event1
* power button: /dev/input/event1
Line 215:
Line 218:
* rotate, cursor, and game pad keys: /dev/input/event10
* rotate, cursor, and game pad keys: /dev/input/event10
* mouse : /dev/input/mice
* mouse : /dev/input/mice
+
+
+
For example, the code below waits till the ebook switch state changes and pushes the status to the heap
def myblock(tw, x): # ignores second argument
def myblock(tw, x): # ignores second argument
Tonyforster
2,486
edits