You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 25, 2024. It is now read-only.
I've been considering how we should implement Ultrasound sensor support, which is an interesting problem, as mentioned previously in #66.
I propose implementing a sort-of layer that sits above Components in our abstraction, I have deemed these to be 'Meta-Components' 'Derived Components'.
A meta-component derived component is simply a component that is defined by the user, rather than the API author. At first this may sound like it doesn't work with our current intentions for how students will use the API, but I think this makes a lot of sense.
I think the easiest way to do this is with a few code examples.
Example 1: A fixed Ultrasound sensor on a robot / board.
This will obviously require a new Component and Interface to be defined, but note in particular how this "Meta-Component" 'derived component' does not take a Backend as a parameter in it's constructor, instead taking GPIOPins and using their Backend.
The text was updated successfully, but these errors were encountered:
I do have a nitpick about the name: "meta-component" sounds like something that describes a component, like how a Python metaclass describes a class or how metadata in general describes some distinct but related data. How about something like "composite component" or "derived component", that indicates that it's a component built from other components?
trickeydan
changed the title
Meta-Components: A layer above components.
Derived Components: A layer above components.
Apr 14, 2019
From what I've been able to determine, this does not require any additional base classes, it is instead a design pattern that we should use. I shall write some docs on this in order to finish this off.
Introduction
I've been considering how we should implement Ultrasound sensor support, which is an interesting problem, as mentioned previously in #66.
I propose implementing a sort-of layer that sits above Components in our abstraction, I have deemed these to be
'Meta-Components''Derived Components'.A
meta-componentderived component is simply a component that is defined by the user, rather than the API author. At first this may sound like it doesn't work with our current intentions for how students will use the API, but I think this makes a lot of sense.I think the easiest way to do this is with a few code examples.
Example 1: A fixed Ultrasound sensor on a robot / board.
Robot class
Student Code
Example 2: Ultrasound wired to GPIO with fw support
Robot class
Student Code
This will obviously require a new Component and Interface to be defined, but note in particular how this
"Meta-Component"'derived component' does not take aBackend
as a parameter in it's constructor, instead takingGPIOPin
s and using theirBackend
.The text was updated successfully, but these errors were encountered: