-
-
Notifications
You must be signed in to change notification settings - Fork 4
Support SourceBots Arduino #66
Comments
I think canonically ultrasound sensors should be a component; however this may require a rethink of the component API due to how ultrasound sensors are addressed as a pair of pin numbers (trigger pin and echo pin). |
For ultrasound sensors, we could have a 'virtual' |
yeah. There's no reason why we couldn't have high-level components built on top of low-level components. I'm thinking something like: class ServoAssembly:
...
def ultrasound_sensor(self, trigger_pin, echo_pin):
if isinstance(trigger_pin, int): trigger_pin = self.gpio[trigger_pin]
if isinstance(echo_pin, int): echo_pin = self.gpio[echo_pin]
return UltrasoundProximitySensor(self._backend, trigger_pin, echo_pin)
...
class UltrasoundProximitySensor:
@property
def distance(self):
return self._backend.read_ultrasound_sensor(self._trigger_pin.identifier, self._echo_pin.identifier) |
Ultrasound isn't implemented in the hardware backend yet. Fortunately this is just a matter of extending the existing EDIT: also need to implement |
#365 fixed this. |
Requires:
The text was updated successfully, but these errors were encountered: