makenai / robotnik

Drag and drop robotics educational library starring Johnny Five and Blockly (crowd goes wild)
52 stars 13 forks source link

Workshop Format #21

Open makenai opened 9 years ago

makenai commented 9 years ago

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?

{
  title: 'Makerland Workshop',
  description: 'This is a workshop for Makerland Conference using a sumobot kit
  with an LED and a proximity sensor.',
  components: [
    {
      component: 'Led',
      pin: 13
    },
    {
      component: 'Servo',
      pin: 7,
      type: 'continuous'
    },
    {
      component: 'Servo',
      pin: 11,
      type: 'continuous'
    },
    {
      component: 'Sensor',
      pin: 'A0'
    }
  ],
  exercises: [
    {
      text: 'First, try to make an LED blink when you push a button.'
    },
    {
      text: 'Now make a motor turn clockwise'
    }
  ]
}
Resseguie commented 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.

makenai commented 9 years ago

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.

Resseguie commented 9 years ago

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.

Resseguie commented 9 years ago

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.

Resseguie commented 9 years ago

@makenai I'll think it through some more in relation to your comments about about making it as controller neutral as possible.

ajfisher commented 8 years ago

I'm pretty sure this is all now reflected in our latest updates