|
ME 405 Romi
|
Initializes Bump sensors. More...
Public Member Functions | |
| __init__ (self, p1, p2, p3) | |
| This initializes the Pins to input pins and enables internal pull-ups for one set of bump sensors (three switches). | |
| is_pressed (self) | |
| This function tests if any one of three sensors has been pressed. | |
Public Attributes | |
| Pin_A = Pin(p1,mode=Pin.IN, pull=Pin.PULL_UP) | |
| Pin_B = Pin(p2,mode=Pin.IN, pull=Pin.PULL_UP) | |
| Pin_C = Pin(p3,mode=Pin.IN, pull=Pin.PULL_UP) | |
Initializes Bump sensors.
This class manages bump sensors for romi, to detect any collisions.
The bump sensor we are using is made specifically for the Pololu Romi, and is placed on the front of the chassis board. The sensors should be connected to digital input pins, with their internal pull ups enabled. This means that the lines will be floating up and will be pulled down when a switch is pressed.
Definition at line 10 of file bump__sensor.py.
| bump__sensor.Bump_Sensor.__init__ | ( | self, | |
| p1, | |||
| p2, | |||
| p3 ) |
This initializes the Pins to input pins and enables internal pull-ups for one set of bump sensors (three switches).
| P1 | Pin Object |
| P2 | Pin Object |
| P3 | Pin Object |
Definition at line 15 of file bump__sensor.py.
| bump__sensor.Bump_Sensor.is_pressed | ( | self | ) |
This function tests if any one of three sensors has been pressed.
Returns
True if a sensor is pressed
Definition at line 26 of file bump__sensor.py.
| bump__sensor.Bump_Sensor.Pin_A = Pin(p1,mode=Pin.IN, pull=Pin.PULL_UP) |
Definition at line 17 of file bump__sensor.py.
| bump__sensor.Bump_Sensor.Pin_B = Pin(p2,mode=Pin.IN, pull=Pin.PULL_UP) |
Definition at line 18 of file bump__sensor.py.
| bump__sensor.Bump_Sensor.Pin_C = Pin(p3,mode=Pin.IN, pull=Pin.PULL_UP) |
Definition at line 19 of file bump__sensor.py.