Module raspibrick
[hide private]
[frames] | no frames]

Module raspibrick

source code


This software is part of the raspibrick module.
It is Open Source Free Software, so you may
- run the code for any purpose
- study how the code works and adapt it to your needs
- integrate all or parts of the code in your own programs
- redistribute copies of the code
- improve the code and release your improvements to the public
However the use of the code is entirely your responsibility.

Functions [hide private]
 
getKey()
Waits for a key stroke.
source code
 
readKey()
Single character input.
source code
 
isButtonHit() source code
 
isEnterHit() source code
 
isEscapeHit() source code
 
isUpHit() source code
 
isDownHit() source code
 
isLeftHit() source code
 
isRightHit() source code
Variables [hide private]
  MOTOR_LEFT = 0
  MOTOR_RIGHT = 1
  IR_CENTER = 0
  IR_LEFT = 1
  IR_RIGHT = 2
  IR_LINE_LEFT = 3
  IR_LINE_RIGHT = 4
  LED_FRONT = 0
  LED_LEFT = 1
  LED_REAR = 2
  LED_RIGHT = 3
  LS_FRONT_LEFT = 0
  LS_FRONT_RIGHT = 1
  LS_REAR_LEFT = 2
  LS_REAR_RIGHT = 3
  BUTTON_LONGPRESSED = 3
  BUTTON_PRESSED = 1
  BUTTON_RELEASED = 2
  BUTTON_CLICKED = 4
  BUTTON_DOUBLECLICKED = 5
Function Details [hide private]

getKey()

source code 

Waits for a key stroke. A key stroke may generate 1, 2, 3 or 4 characters, e.g. cursor up: x,y,z with ord(x) = 27, ord(y) = 91, ord(z) = 65

Returns:
one character (string) of key sequence

readKey()

source code 

Single character input. Read cursor keys.

Returns:
one character (string) for normal keys, special value for cursor keys: # 16:Up, 17:Down, 18:Right, 19:Left