Python: module hdaps
vim:fileencoding=iso-8859-1:ft=python
Yet another HDAPS class
Copyright (c) Phillip Berndt, 2006
Call this file for some examples.
Classes |
| |
- HDAPS
- Smack
class HDAPS |
|
A basic class for HDAPS access |
|
Methods defined here:
- __init__(self)
- calibrate(self)
- Calibrate the object using the HDAPS calibration
- getAbsolute(self)
- Get absolute position
- getRelative(self, round=1)
- Get relative position
The parameter round is for rounding values
(p.e. round = 5 means every value x returned will be
x mod 5 = 0)
- getShock(self, sens=10)
- Wait until a shock in the X-values is noticed
(e.g. someone hit the notebook from the side)
Sens means sensitivity. Higher values means less
false-positives and more true-negatives.
This function will ignore anything if the laptop
if moved too much
Data and other attributes defined here:
- HIT_LEFT = 1
- HIT_RIGHT = -1
|
class Smack |
|
A smack class (for smackbook-like applications)
Override this one ;) |
|
Methods defined here:
- __init__(self)
- hit_left(self)
- This function is called when the laptop
is hit on the left side
- hit_right(self)
- This function is called when the laptop
is hit on the right side
- loop(self)
- Loop and wait for shocks
Data and other attributes defined here:
- myHDAPS = None
| |