Monday, March 9, 2009

Modkit <--> Arduino Interaction

Edit (June 19, 2011): This post is outdated and describes an early prototype software system and a hardware system that Modkit has not continued developing.  We left this post up as it explains some of the reasoning behind a few important design decisions in the software interface.  For an up to date view of how Modkit works with Arduino, please check out our software features.

From the start of the new year I've been moving towards polishing up my modkit work and getting it out.. Besides not being able to devote enough time, I had hit a mental roadblock about how modkit would interact with scratch at the community level and arduino at both the technical and community levels. This meant that when I had cycles to spare (that could have been used to make progress) I could not just dive into implementing things since the philosophical questions still lingered.. People that have seen the prototype interface may recall that I used arduino language blocks including setup and loop function blocks with the blocks resembling scratch graphically..


I have been milling over this and think I've reached some clarity.. I will likely distinguish the blocks from scratch graphically (so as not to confuse users) and I've decided to move away from these arduino constructs and work through what makes sense given modkit's unique goal: Ages 6 - 106, ie: Modkit should be usable by both children and adults and in industry (in prototyping initially).. It is possible that I may come back to these constructs and/or syntax, but only if and when it makes sense given the goals of the Modkit project.. At the same time, I think the Arduino hardware, software, and community will be very important to Modkit and have laid out how I think they will interact:

Arduino ----> Modkit

1) Arduino libraries and shields (or hardware tutorials) can be converted to modblocks hardware and interfaces. This means that modkit can leverage the large number of user contributed libraries by adding simply modkit-bus libraries and creating a modbus interface..

2) Arduino(w/modkit-bus hardware or hack) or Modkit-Arduino can be used to prototype new modblocks hardware modules.. This is very important.. Arduino is essentially the moblocks prototyping module.. In fact, I am using arduino to prototype the new modkit-bus right now (see Serial.end() question below)..


Modkit ----> Arduino

1) Modblocks (modkit's visual ide) programs can be converted to arduino sketches
. When targeting arduino or modkit-arduino (arduino or arduino clone with modkit-bus hardware interface), pin-level functionality is available.. These programs can be converted to arduino sketches using modkit arduino libraries for editing/exploring/flashing/
interpreting(modkit c interpreter).. The main program will be converted to use the setup/loop construct in some non-opaque way.. This means that modkit users (kids and non-programmer adults) can start with simple blocks programing and move to the wide arduino world seamlessly..

2) Modblocks (modkit's hardware) modules can be used with arduino hardware/software using modkit<->arduino interface hardware, and modkit arduino libraries.. This means that any unique modules developed for modkit will be easily usable by arduino users with a hardware interface which can be as simple as a single diode (must disable usb) or with a cheap add on board/shield..


Modkit-bus Software Interaction:

The modkit-bus software interface can be added to standard arduino programs by inclusion of the modkit-bus libraries, but I need a Serial.end() method as described in the following post:

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1232485147


I haven't had any luck getting anyone on the arduino project interested in this, but I haven't poked around much.. I will likely push to get this support in the arduino Serial library directly or will just add my own, more feature rich Serial library.. Everything else could be contained in the modkit-bus libraries..

Modkit-bus Hardware interaction:

The modkit-bus hardware interface can be added to standard arduinos through rx/tx pins and a simple diode (must disable usb) or through a cheap add on module/sheild using a software serial interface..

-Ed

No comments:

Post a Comment