# Experience with block languges?

**URL:** <https://community.particle.io/t/experience-with-block-languges/30754>\
**Category:** General\
**Created:** [March 21, 2017, 9:54pm UTC](https://community.particle.io/t/experience-with-block-languges/30754 "2017-03-21T21:54:58Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 21, 2017, 9:54pm UTC](https://community.particle.io/t/experience-with-block-languges/30754/1 "2017-03-21T21:54:58Z")

</div>

Hello.

I am trying to see if anyone has had any luck with Photons and snap4arduino, s4a.cat, or some other block-based language.

Thanks,

Michael

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [March 22, 2017, 12:32am UTC](https://community.particle.io/t/experience-with-block-languges/30754/2 "2017-03-22T00:32:09Z")

</div>

I can’t say that I have, but then I would say if you are using a block language you are not programming.

Have looked into [Node Red](http://nodered.org/) though? It lets you link IOT services and things together in a block like way.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 22, 2017, 3:07am UTC](https://community.particle.io/t/experience-with-block-languges/30754/3 "2017-03-22T03:07:04Z")

</div>

Thanks for your reply, nrobinson2000. I looked at Node-RED a bit, but the groups I’m trying to introduce programming to (middle to high school students) are more likely to have seen Scratch and (possibly) Snap!, and if they work with Arduino, I figure they might work with Photon as well – I plan to try tomorrow.

I’m not sure if I buy your argument that visual programming isn’t programming – it is _different_, and (_possibly_) more cumbersome than writing code, but a) it is instructing the computer to do something, b) it does involve all the standard structures and concepts you’ll see in a text-based programming language (variables, loops, decision structures, first class lists, first class functions, objects, abstraction). If you’ve got some time, take a look at [Snap!](http://snap.berkeley.edu) in particular, and how it’s used [at Berkeley](http://cs10.org/sp17/), I think you’ll be pleasantly surprised.

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [March 22, 2017, 3:20am UTC](https://community.particle.io/t/experience-with-block-languges/30754/4 "2017-03-22T03:20:26Z")

</div>

> [@mprogers](#):
>
> I'm not sure if I buy your argument that visual programming isn't programming -- it is different, and (possibly) more cumbersome than writing code, but a) it is instructing the computer to do something, b) it does involve all the standard structures and concepts you'll see in a text-based programming language (variables, loops, decision structures, first class lists, first class functions, objects, abstraction). If you've got some time, take a look at Snap! in particular, and how it's used at Berkeley, I think you'll be pleasantly surprised.

I was only joking. 😉 I started my programming journey with Scratch when I was eleven and I had a lot of fun with it until I outgrew it.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 22, 2017, 9:34pm UTC](https://community.particle.io/t/experience-with-block-languges/30754/5 "2017-03-22T21:34:28Z")

</div>

Just to follow up, I’ve played around with [Snap4Arduino](http://snap4arduino.org/index.html), using[Firmata for Spark](https://github.com/firmata/spark) – it’s available in the libraries, StandardFirmata.ino – and I can now control my Photon through that (hurray!).

However, Snap4Arduino only has blocks for the basics (setting pins, and getting analog and digital readings from them).

[SA5Firmata\_2](https://github.com/jguille2/SA5/), which works with Snap! and Arduino, comes with additional Arduino-specific Snap! blocks, but not all of the ones that would be suitable for Particle (e.g., ones to publish/subscribe), and it doesn’t seem to work with the Photon.

Does anyone with a better idea of what Firmata is doing (and that’s probably everyone reading this) have an idea how I add additional blocks to Snap4Arduino to provide addess to more Particle functionality? Is this even possible?

Thanks for any insights …

---

<div class="post-metadata">

**Author:** ![nrobinson2000](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/nrobinson2000/32/15624_2.png) [@nrobinson2000](https://community.particle.io/u/nrobinson2000)\
**Post date:** [March 23, 2017, 2:40pm UTC](https://community.particle.io/t/experience-with-block-languges/30754/6 "2017-03-23T14:40:47Z")

</div>

I’m fairly certain that those block based languages control the device in real time like Tinker over serial.

---

<div class="post-metadata">

**Author:** ![peekay123](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/peekay123/32/810_2.png) [@peekay123](https://community.particle.io/u/peekay123)\
**Post date:** [March 23, 2017, 5:28pm UTC](https://community.particle.io/t/experience-with-block-languges/30754/7 "2017-03-23T17:28:53Z")

</div>

I agree with @nrobinson2000. Firmata is designed to be remotely controlled, providing an API to the controlling device. Without the controlling device, Firmata does nothing.

---

<div class="post-metadata">

**Author:** ![mprogers](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/mprogers/32/18458_2.png) [@mprogers](https://community.particle.io/u/mprogers)\
**Post date:** [March 24, 2017, 1:12am UTC](https://community.particle.io/t/experience-with-block-languges/30754/8 "2017-03-24T01:12:28Z")

</div>

OK, so I’m begining to get a glimmer of how this is workng … Snap4Arduino is sending byte streams to StandardFirmata, which is running on my Photon. But it’s still basically a Photon, correct, in communication with the Particle Cloud?

The reason I ask is because, in StandardFirmata.ino’s setup(), I’ve defined Particle.variable(“pinChosen”,pinChosen);, yet both Particle-Dev and the web console deny all knowledge of such a variable (indeed any Particle variables).

Related to this, is it possible to debug an .ino file in Firmata? I don’t see any debugging tools, and I think my serial port is being used by Fermata, so I can’t even see if the new command I’ve created, as per [these instructions here](http://blog.s4a.cat/2015/03/13/Extending-Firmata-for-Snap4Arduino.html), is being invoked.

---

<div class="post-metadata">

**Author:** ![Moors7](https://sea2.discourse-cdn.com/flex026/user_avatar/community.particle.io/moors7/32/588_2.png) [@Moors7](https://community.particle.io/u/Moors7)\
**Post date:** [March 24, 2017, 8:24am UTC](https://community.particle.io/t/experience-with-block-languges/30754/9 "2017-03-24T08:24:59Z")

</div>

> [@mprogers](#):
>
> both Particle-Dev and the web console deny all knowledge of such a variable (indeed any Particle variables).

Try placing those at the top of the setup() function, that might make a difference if they weren't there already.
