<html>
<head>
<style><!--
.hmmessage P
{
margin:0px;
padding:0px
}
body.hmmessage
{
font-size: 10pt;
font-family:Tahoma
}
--></style></head>
<body class='hmmessage'><div dir='ltr'>
this sounds as thou it has legs, very much along the ideas of the lego programming language which was visual blocks ( as it's lego what other concept would they use!)<div>if you need some help with the node.js stuff gimme a shout, as it's my app server for my FT work</div><div>Regards Pete<br><br><div><div id="SkyDrivePlaceholder"></div>&gt; From: developers-request@concurrency.cc<br>&gt; Subject: developers Digest, Vol 26, Issue 3<br>&gt; To: developers@concurrency.cc<br>&gt; Date: Wed, 4 Jul 2012 12:00:02 +0100<br>&gt; <br>&gt; Send developers mailing list submissions to<br>&gt;         developers@concurrency.cc<br>&gt; <br>&gt; To subscribe or unsubscribe via the World Wide Web, visit<br>&gt;         http://lists.concurrency.cc/mailman/listinfo/developers<br>&gt; or, via email, send a message with subject or body 'help' to<br>&gt;         developers-request@concurrency.cc<br>&gt; <br>&gt; You can reach the person managing the list at<br>&gt;         developers-owner@concurrency.cc<br>&gt; <br>&gt; When replying, please edit your Subject line so it is more specific<br>&gt; than "Re: Contents of developers digest..."<br>&gt; <br>&gt; <br>&gt; Today's Topics:<br>&gt; <br>&gt;    1. Prototype drag-and-drop (Matt Jadud)<br>&gt; <br>&gt; <br>&gt; ----------------------------------------------------------------------<br>&gt; <br>&gt; Message: 1<br>&gt; Date: Tue, 3 Jul 2012 10:53:18 -0400<br>&gt; From: Matt Jadud &lt;matt@jadud.com&gt;<br>&gt; Subject: [CCC DEV] Prototype drag-and-drop<br>&gt; To: developers@concurrency.cc<br>&gt; Message-ID:<br>&gt;         &lt;CAAGM454YB1iQkgEgykGyZsmqe9QigRDrN3ZEWHq5TzuiZHjv0Q@mail.gmail.com&gt;<br>&gt; Content-Type: text/plain; charset=ISO-8859-1<br>&gt; <br>&gt; Hi all,<br>&gt; <br>&gt; [ TL;DR: It's a prototype visual environment. I have no idea if I've<br>&gt; just reinvented something we already had around. Is it worth pursuing<br>&gt; further, and who is interested? ]<br>&gt; <br>&gt; I have a prototype drag-and-drop environment for the Arduino.<br>&gt; <br>&gt; http://www.youtube.com/watch?v=ejzbrOroHTw<br>&gt; <br>&gt; The source (*cough*) is in Github:<br>&gt; <br>&gt; https://github.com/craftofelectronics/ardu-see<br>&gt; <br>&gt; To save you digging through a pile:<br>&gt; <br>&gt; 1. The web interface is thrown together with WireIt, which is built on<br>&gt; the YUI library from Yahoo. Yahoo Pipes is built using this library.<br>&gt; <br>&gt; 2. The blocks in the interface are specified in JSON. For example, the<br>&gt; "Read Sensor" block specification looks like this:<br>&gt; <br>&gt;   {<br>&gt;     "name": "Read Sensor",<br>&gt;     "container": {<br>&gt;       "xtype": "WireIt.FormContainer",<br>&gt;       "title": "read_sensor",<br>&gt;       "icon": "res/icons/application_edit.png",<br>&gt;       "collapsible": true,<br>&gt;       "fields": [<br>&gt;         {"type": "select", "inputParams": {"label": "Pin", "name":<br>&gt; "1int", "selectValues": ["A0", "A1", "A2", "A3", "A4", "A5"] } },<br>&gt;       ],<br>&gt;       "terminals": [<br>&gt;         {"name": "0out", "direction": [0,1], "offsetPosition":<br>&gt; {"left": 100, "bottom": -15}}<br>&gt;         ],<br>&gt;       "legend": "Read my sensor and output its value."<br>&gt;                    }<br>&gt;            }<br>&gt; <br>&gt; There are some fragile things in here. For example, the names are<br>&gt; "0out" and "1int", which are how I'm encoding parameter order and<br>&gt; type. (But, the prototype is assuming that everything is an INT,<br>&gt; because it is 1) invisible to the user and 2) allows for a great deal<br>&gt; of flexibility.)<br>&gt; <br>&gt; 3. When you hit Load or Save, it pushes your data to http://parse.com/.<br>&gt; <br>&gt; 4. When you hit Run, it pushes a JSON representation of the graph to a<br>&gt; Node.JS server. (Why? Because it was the easiest thing I could find<br>&gt; that would serve both static content and an RPC call.)<br>&gt; <br>&gt; 5. The JSON server runs a small Scheme utility to 1) parse the JSON<br>&gt; and 2) spit out a piece of occam-pi. Given a JSON structure like this:<br>&gt; <br>&gt; {"name":"","project":"","working":{"modules":[{"name":"Read<br>&gt; Sensor","value":{"1int":"A0"},"config":{"position":["18","24"]}},{"name":"Turn<br>&gt; On In Range","value":{"1int":"2","2int":"0","3int":"100"},"config":{"position":["104","223"]}}],"wires":[{"src":{"moduleId":"0","terminal":"0out"},"tgt":{"moduleId":"1","terminal":"0in"}}],"properties":{"name":"","project":"","description":""}}}<br>&gt; <br>&gt; it outputs<br>&gt; <br>&gt; <br>&gt; #INCLUDE "ardu-see-ardu-do.module"<br>&gt; PROC main1341326514 ()<br>&gt;   CHAN INT wire01:<br>&gt;   PAR<br>&gt;     ReadSensor(A0, wire01!)<br>&gt;     TurnOnInRange(2, 0, 100, wire01?)<br>&gt; :<br>&gt; <br>&gt; 6. For this to work, we have to implement each block in occam-pi.<br>&gt; That's not hard.<br>&gt; <br>&gt; #INCLUDE "plumbing.module"<br>&gt; <br>&gt; VAL INT READ.DELAY IS 500:<br>&gt; <br>&gt; PROC ReadSensor (VAL INT pin, CHAN INT out!)<br>&gt;   INITIAL INT avr.pin IS board.analog.to.chip(pin):<br>&gt;   WHILE TRUE<br>&gt;     INT reading:<br>&gt;     SEQ<br>&gt;       delay(READ.DELAY)<br>&gt;       adc.base(avr.pin, VCC, reading)<br>&gt;       out ! (reading / 11)<br>&gt; :<br>&gt; <br>&gt; PROC TurnOnInRange (VAL INT pin, min, max, CHAN INT in?)<br>&gt;   WHILE TRUE<br>&gt;     INT value:<br>&gt;     SEQ<br>&gt;       in ? value<br>&gt;       IF<br>&gt;         (value &gt;= min) AND (value &lt;= max)<br>&gt;           digital.write(pin, HIGH)<br>&gt;         TRUE<br>&gt;           digital.write(pin, LOW)<br>&gt; :<br>&gt; <br>&gt; 7. The Node.JS server then invokes the toolchain and uploads things.<br>&gt; (My Mac environment for command-line building is poor, so really, I<br>&gt; should just be able to call "occbuild" and be done. But, that's not<br>&gt; how this script works at the moment.)<br>&gt; <br>&gt; 8. Upload is handled by avrdude. My Arduino is hardcoded in.<br>&gt; <br>&gt; That's about it, really. It's a prototype. I put it together because<br>&gt; I'd like to teach an intro electronics course that has digital<br>&gt; electronics, but I'd rather not have to teach programming (per se).<br>&gt; Going to tools like Ardublocks or Modkit means a sequential world, and<br>&gt; students still have to wrestle through lots of details that are, quite<br>&gt; simply, unpleasant. (Or, if you prefer: if the course was primarily<br>&gt; and only about digital electronics and an introduction to programming,<br>&gt; I could probably fit a bit more programming instruction in... but, at<br>&gt; the moment, I suspect not.)<br>&gt; <br>&gt; My question is: can we bring this around before September-ish? Specifically:<br>&gt; <br>&gt; 1. Can we put together something that runs on Mac and Windows?<br>&gt; (Ideally, all three.)<br>&gt; 2. The JavaScript side is, for all intents and purposes, "done." That<br>&gt; is, adding new blocks is easy. Writing a bit of occam to represent the<br>&gt; block is likewise easy.<br>&gt; 3. We can write the server in anything we like: a stand-alone Python<br>&gt; server that gets the job done works for me. I may explore whether it<br>&gt; is possible to easily get a (compiled) stand-alone server to run in<br>&gt; Scheme. If so, that would solve cross-platform packaging.<br>&gt; 4. The user needs to find/specify the Arduino... somehow. I have some ideas.<br>&gt; 5. Some error checking, somewhere, might be a good idea.<br>&gt; <br>&gt; It would be nice to have something that leveraged our tools that<br>&gt; anyone could use to quickly explore the Arduino. The environment is<br>&gt; highly constrained, and allows me (as an educator) to limit what<br>&gt; students are able to do in sensible ways. Or, if you prefer, the<br>&gt; environment lets students focus on the circuit and the problem they're<br>&gt; trying to solve, and not get lost in details of the programming...<br>&gt; while allowing them to easily prototype systems with multiple sensors,<br>&gt; on multiple inputs, with multiple outputs.<br>&gt; <br>&gt; That's enough writing. I'll probably put a blog post up on<br>&gt; http://craftofelectronics.org/ about this, which might be less<br>&gt; verbose, more conceptual, and clearer.<br>&gt; <br>&gt; Many thanks,<br>&gt; Matt<br>&gt; <br>&gt; <br>&gt; <br>&gt; ------------------------------<br>&gt; <br>&gt; _______________________________________________<br>&gt; developers mailing list<br>&gt; developers@concurrency.cc<br>&gt; http://lists.concurrency.cc/mailman/listinfo/developers<br>&gt; <br>&gt; <br>&gt; End of developers Digest, Vol 26, Issue 3<br>&gt; *****************************************<br></div></div>                                               </div></body>
</html>