Open makenai opened 9 years ago
Yes. I was thinking that there would be a device configuration panel. This is where you say "I'm using a SparkCore with these parameters" or "I have a continuous servo attached to pin 10". These things would have visual representations in the configuration panel, and provide a context for the blocks to run in. These component configurations would persist as JSON data in the project.
One cool idea I've talked with @rwaldron with before is support for Fritzing or a Fritzing like drag and drop configuration system, so you can just drag a servo to a SparkCore and connect to pin 10.
In a pinch, a dropdown on each pin would be useful, It would also be good to have prompts that show the pin capabilities and warn the use when they try doing something like connecting a servo to a non-PWM pin.
(clarification: what Rick actually wanted was a Fritzing-like J5 simulator - but this could be a first step)
I could see that type of interface in a 'Build' or 'Components' tab next to blocks. If a teacher was working with a pre-wired kit or project, we could add ability to disable that tab.
Hmm, I had been thinking of something like this similar to @rwaldron's Fritzing-like simulator idea. But making it bidirectional as a configuration capability would be nice.
Just noting that what we do here will depend on details worked out for #21
Right now the boilerplate code (that surrounds the generated code) is hard coded in robotnik.js as preCode and postCode. To work for @BrianGenisio's plan of pluggable configurations, we're going to need to define the hardware components and pins elsewhere.
We should also have flexible boilerplate so we can support different kinds of boards like the SparkCore that will initialize Johnny-Five differently.