Open makenai opened 9 years ago
Besides the double use of 'type'? ;)
I like the concept. Would it be helpful instead of using just "led" and "servo" to map to the newer Johnny-Five notion of devices/controllers/etc? Then you could specify specific boards and/or components for use at a workshop.
good catch. I've updated it to 'component'. Can you explain the new J5 notation further?
re controllers: I'm hoping to keep this controller neutral and let people change to different controller boards in the local settings. I guess that would mean no direct pin mappings? Maybe mapping to pin capabilities instead of numbers. Another good point.
Hey @dtex did you have a summary of the relationship of components, devices, etc written up somewhere? I'm afraid I'll butcher it and want to make sure we map them correctly here.
Found it: https://github.com/rwaldron/johnny-five/issues/486#issuecomment-63515604
A typical instantiation might look like:
var lcd = new five.LCD({
controller: "PCF8574T"
});
So the components array might look like this:
{
class: 'LCD',
controller: "PCF8574T", // optional
pin: 13
},
thoughts?
@dtex We're basically wanting to have a JSON file format that we can use to specify what devices are plugged in where and generate some boilerplate code for use with Blockly.
@makenai I'll think it through some more in relation to your comments about about making it as controller neutral as possible.
I'm pretty sure this is all now reflected in our latest updates
I'm thinking of using a workshop format like this to define components and workshop steps. This would define the blocks that appear during the workshop, help generate the pre and post code, possibly generate a schematic, and have helpful steps to guide people. I'm going to work toward making a proof of concept that uses this. Later, this format could be generated within robotnik its self as part of the 'build' or 'circuit' tab.
Thoughts?