Graphical IDE suitable for 6 year old budding programmer.

Is there a graphical IDE, such as Blockly (I believe there are several others similar), that would translate into something an Arduino could use?
My 5-year-old grandson is mad-keen on anything programmable or electrical, and he has already used graphical interfaces in web-based 'programming' games, but I have just made him a car (currently radio controlled) that I would like to put a Nano onto, and make it programmable to do various things. His parents aren't keen on him spending too much time in front of a screen, so the car seems like a compromise.
My own background is in C, but it seems that Python is taking the world by storm, so if there's a Python compiler that outputs .hex files, and then a graphical language that would output Python, that would give me a path to follow from graphical into proper programming.

Lego has a graphical programming interface for its robot modules. Look up Mindstorms.

There is a thing called ardublock but I have never used it.

As you are familiar with C the most effective thing may be to introduce him directly to programming using the Arduino IDE which uses C++. For example you could write an initial program and then teach him how to modify and extend it. And it would avoid you having to learn ardublock (or whatever graphical system you settle for).

Never underestimate the ability of enthusiastic children to learn things.

...R

Thanks Robin, I'll look up ardublock. Whatever language I use, I want him to be able to achieve something with it, without too much effort, so C is a non-starter. He's still learning to read, and still at the stage where looking at a picture is so much easier that it's much more attractive. He definitely shies away from any written language, though I did think that if I had a graphical interface, that would be attractive to him, and if it output Python, we could spend a little time looking at the textual language, see how it relates to the program he built, and that it's nothing to be afraid of. Then, bit by bit, (character by character?) move onto it as his reading and writing skills improve. I don't think that starting him off with a written language would encourage enthusiasm at this point.

Robin, At first, I did a google search for Ardublock, and as I typed it, google predicted that I was going to write "ardublockly". Blockly is a language my grandson has used before, so I looked at it, and it looks eminently suitable, but later, I clicked on your link to Ardublock and found it was different. The two languages look so similar that there's really not much difference, but I'll explore them and figure out which I think will be better.
Thanks very much for the advice.

nalkot:
but I'll explore them and figure out which I think will be better.

Sorry I can't help. I have no experience with either

If you can take the trouble to report your experiences here from time to time it would be helpful for other parents / grandparents in a similar situation.

And with that in mind it would probably help if you can modify your Original Post and change the Title to "Graphical IDE suitable for young children"

...R

Hi

You might want to take a look at XOD for the arduino

Here - https://xod.io/

It talks directly to an attached arduino and can also generate C++ code which can be run through the Arduino IDE.

I found out about it from these two tutorials:-

Part 1 here - Arduino Programming with XOD - Learning XOD - YouTube

Part 2 here - Arduino Programming with XOD #2 - Robot Car - YouTube

Bill (the guy who presents the tutorials) has a somewhat unique style and his editing can be a touch idiosyncratic but there is a lot of good stuff there.

Let us know how you and your grandson get on.

All the best

Ian

I'm using Arduino IDE 1.8.12, and it occurs to me that maybe it has moved on since Ardublock finished its development, and that the old version of Ardublock no longer interfaces with it properly. On Sourceforge, it seems that the last mention of Ardublock was 6 years ago. I've looked at the setup instructions on YouTube, and the graphical package is linked with my Arduino IDE, but on the demo, when a program is created in Ardublock and uploaded, it writes a C program into the IDE which can then be compiled for the Arduino Nano - but that doesn't work on mine. When I upload, it puts lots of brown text in the bottom window of the IDE (copied below), but indicates that there is an error. I don't speak Java, so I haven't been able to decode it all - but the first word is fairly damning - "Exception".

In YouTube demonstrations, some versions of Blockly have a "program" block, which has a "Setup" socket and a "Loop" socket - very much like the way the Arduino is programmed - but my version of Ardublock doesn't. It has a "Loop" block, but in order to do a setup, I would have make a variable called Setup_var, and do ...

Loop
{ If (Setup_var == 0)
{ Perform_setup();
Setup_var = 1;
}
// rest of loop
}

.... but that means testing the variable on each iteration of the loop, which seems a bit cumbersome. It's odd that they dropped the Program block. They should have replaced it with a Setup block, then we'd have had the best of both worlds. Anyway, it doesn't produce any code I can compile for the Arduino, and I get the feeling that the Ardublock project has been abandoned.

When I hit "Upload", here's what gets sent to the IDE. Nothing appears in the upper window, where the C program would normally go.

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: processing.app.Editor.setText(Ljava/lang/String;)V
at com.ardublock.ArduBlockTool.didGenerate(ArduBlockTool.java:62)
at com.ardublock.core.Context.didGenerate(Context.java:253)
at com.ardublock.ui.listener.GenerateCodeButtonListener.actionPerformed(GenerateCodeButtonListener.java:174)
at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
at java.awt.Component.processMouseEvent(Component.java:6539)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
at java.awt.Component.processEvent(Component.java:6304)
at java.awt.Container.processEvent(Container.java:2239)
at java.awt.Component.dispatchEventImpl(Component.java:4889)
at java.awt.Container.dispatchEventImpl(Container.java:2297)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
at java.awt.Container.dispatchEventImpl(Container.java:2283)
at java.awt.Window.dispatchEventImpl(Window.java:2746)
at java.awt.Component.dispatchEvent(Component.java:4711)
at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
at java.awt.EventQueue.access$500(EventQueue.java:97)
at java.awt.EventQueue$3.run(EventQueue.java:709)
at java.awt.EventQueue$3.run(EventQueue.java:703)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
at java.awt.EventQueue$4.run(EventQueue.java:733)
at java.awt.EventQueue$4.run(EventQueue.java:731)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

What about Scratch?

nalkot:
When I hit "Upload", here's what gets sent to the IDE. Nothing appears in the upper window, where the C program would normally go.

Exception in thread "AWT-EventQueue-0" java.lang.NoSuchMethodError: processing.app.Editor.setText(Ljava/lang/String;)V
at com.ardublock.ArduBlockTool.didGenerate(ArduBlockTool.java:62)
at com.ardublock.core.Context.didGenerate(Context.java:253)

In my experience Java errors are the result of a problem in the text of the program that causes Java to choke while examining the code before submitting it to the compiler - perhaps because the IDE code does not have suitable error checking.

That sort of problem can arise when code is copy and pasted and may contain inappropriate characters.

I have no idea whether an older version of the IDE would solve the problem but there should be no problem installing it to see what happens. You can have several versions of the IDE on the same PC. The IDE is just a just Java program.

...R

Thanks Robin, maybe I can look for a 6 year old version of the IDE. It's late now, but I'll look as soon as I get time.

Just another thought. I presume the Java problem was caused when you tried to compile code generated by Ardublock. Does Ardublock produce an .ino file that you can examine?

If so then if you post the contents of the .ino file we may be able to see the cause of the problem.

...R

aarg:
What about Scratch?

Thanks aarg, I looked at the site, but it appears I need to make an account before I can find out what the package is all about - and I'm not going to do that. I don't give my credentials to any site till I know that I want something there, and in this case, I can't find out till I register.

IanCrowe:
You might want to take a look at XOD for the arduino

I'll do that, Ian. I know the guy who presents it - not personally, but I have watched a few of his tutorials before. He's OK. I certainly like the idea that it by-passes the IDE and sends program data directly to the Arduiono - though my initial idea was to involve the IDE so that my pupil could see the C code, and we can eventually work with that. However, I think XOD can do that too as a selectable alternative.
I haven't looked at the vids yet, but I will.

Let us know how you and your grandson get on.

All the best

Ian

Will do!
Thanks for the pointer. Read my other post to Robin, though.

nalkot:
Thanks aarg, I looked at the site, but it appears I need to make an account before I can find out what the package is all about - and I'm not going to do that. I don't give my credentials to any site till I know that I want something there, and in this case, I can't find out till I register.

Agree 100%

...R

Just a comment for anybody following.
I want to make a toy car programmable, which will involve servo motors, so I have wrote a Blockly routine to scan a servo from side to side, one degree at a time. The graphical program was converted to a C++ program in the Arduino IDE, and I couldn't see anything wrong with it, but although the servo was trying to work (with a bit of finger assistance), it just couldn't manage it. I put it to one side while my grandson played Riven, intending to put an oscilloscope on it to see what was wrong, but today, I did a bit of forum reading instead, and the reason it doesn't work is because I was powering the Arduino Nano from USB, and the servo from the Arduino pins (5V, Gnd and signal) - and it seems the USB can't drive enough current to operate the servo. The answer is to power the servo independently from a battery, and drive only its data wire from the Arduino. The negative of the battery has to be connected to the Arduino Gnd to provide a common earth, of course.