ME 405 Romi
Loading...
Searching...
No Matches
bump__sensor.Bump_Sensor Class Reference

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)

Detailed Description

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.

Author
Alex Power, Lucas Heuchert, Erik Heuchert
Date
2025-Dec-8 Approximate date of creation of file
2025-Dec-12 Final alterations made

Definition at line 10 of file bump__sensor.py.

Constructor & Destructor Documentation

◆ __init__()

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).

Parameters
P1Pin Object
P2Pin Object
P3Pin Object

Definition at line 15 of file bump__sensor.py.

Member Function Documentation

◆ is_pressed()

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.

Member Data Documentation

◆ Pin_A

bump__sensor.Bump_Sensor.Pin_A = Pin(p1,mode=Pin.IN, pull=Pin.PULL_UP)

Definition at line 17 of file bump__sensor.py.

◆ Pin_B

bump__sensor.Bump_Sensor.Pin_B = Pin(p2,mode=Pin.IN, pull=Pin.PULL_UP)

Definition at line 18 of file bump__sensor.py.

◆ Pin_C

bump__sensor.Bump_Sensor.Pin_C = Pin(p3,mode=Pin.IN, pull=Pin.PULL_UP)

Definition at line 19 of file bump__sensor.py.


The documentation for this class was generated from the following file: