Trees | Indices | Help |
---|
|
object --+ | MyRobot
Singleton class that represents a robot. Signature for the butten event callback: buttonEvent(int). (BUTTON_PRESSED, BUTTON_RELEASED, BUTTON_LONGPRESSED defined in ShareConstants.)
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
Inherited from |
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
|||
_myInstance = None
|
|
|||
Inherited from |
|
Creates an instance of MyRobot and initalizes the GPIO.
|
Checks if button is currently pressed.
|
Checks, if the button was ever hit or hit since the last invocation.
|
Registers a listener function to get notifications when the pushbutton is pressed, released or long pressed. If enableClick = True, in addition click and double-click events are reported. The click event not immediately reported, but only if within the doubleClickTime no other click is gererated. The value are defined as ShareConstants.BUTTON_PRESSED, ShareConstants.BUTTON_LONGPRESSED, ShareConstants.BUTTON_RELEASED, ShareConstants.BUTTON_CLICKED, ShareConstants.BUTTON_DOUBLECLICKED. With enableClick = False and the button is long pressed and released the sequence is: BUTTON_PRESSED, BUTTON_LONGPRESSED, BUTTON_RELEASED. With enableClick = True the sequences are the following: click: BUTTON_PRESSED, BUTTON_RELEASED, BUTTON_CLICKED double-click: BUTTON_PRESSED, BUTTON_RELEASED, BUTTON_PRESSED, BUTTON_RELEASED, BUTTON_DOUBLECLICKED long pressed: BUTTON_PRESSED, BUTTON_LONGPRESSED, BUTTON_RELEASED
|
Enables/disables the push button. The button is enabled, when the Robot is created.
|
There is a small processor on the PCB (an STM8S003F3P6) which handles the voltage monitoring, as well as trying to reduce the impact of direct light on the IR sensors. It has 2 threshold voltages: At about 6.5V (3 consecutive readings) it flashes the red LED and disables the motor drivers. At about 6.2V it turns the red LED on permanently and sends a signal on GPIO24 pin 18 to the Pi. The software on the Pi can monitor this and shut down gracefully if required. If the voltage goes back above 7.0V then the system resets to Green LED and all enabled. Registers a listener function to get notifications when battery voltage is getting low.
|
|
Plays a single sine tone with given frequency and duration.
|
|
Prepares the given wav or mp3 sound file for playing with given volume (0..100). The sound sound channel is opened and a background noise is emitted.
|
Decreases the volume slowly and stops playing.
|
Sets the volume while the sound is playing.
|
|
Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sun Apr 16 12:46:33 2017 | http://epydoc.sourceforge.net |