Custom Blocks - Programming

Hi,
Im a teacher who works in EdTech. Recently I saw some projects that used an arduino nano on a custom pcb board. It was very basic (could have used a breakout) but it just made it really simple for kids yo plug and play. The workshop I saw the kids didn't do any of the coding as it was short, but they selected the inputs and outputs and assembled it together.

I am trying to develop my own board similar. It also had the possibiity of using a usb power bank or a 4AA battery Holder - the voltage was regulated on the board.

They did have some sort of custom blocks for the coding - it was block programming suitable for kids I assume if you sign up to the longer workshops.

I would like to know - How big is a project like this? Design your own custom blocks? Basically it would be renaming the pins so instead of pin 9 it would say servo - mapping to the custom PCB board I wish I could build.

The board is really simple, I don't think it should cost that much, but I am not sure about the custom blocks.

Any advice would be much appreciated. I am starting with a breakout board and see if I can replicate first, but ideally I will build a custom pcb.

Without knowing more, I would say that is a very ambitious project.

I would look high and low for something that is already established and has a good track record and a large user community.

I am also for not adding more layers of "simplification". Too often it just makes things harder.

I played with real resistors and capacitors and stuff in the not-misspent parts of my youth and had to learn basic electronics while doing.

A friend had a whizzy electronics kit with magnetic modules that had resistor and capacitors and stuff, but they were just too fiddly and opaque, it failed to deliver on its promises and ended up probably driving him into poetry or wood-working.

a7

Sounds similar to the Arduino Alvik Robot.
You might get some ideas from that.

Already done for you
~~Arduino Project Hub

How does this solve my problem? I see block programming but how can you map the pins to custom blocks using names on my own board - Like Servo = Pin 9 for excampel

Sorry, appears to be another Arduino project hub DUD, the wiki does does not exist.

have you seen Introduction to Raspberry Pi Pico: LEDs, buzzers, switches, and dials part of the Code Club Projects

Open the source code and change it. But be warned that these "Scratch" based GUIs are only suitable for one specific class of users: teachers. Nobody else benefits from them, especially not kids.

I am aware that the block programming isnt always the best for kids, however it is what most use at this age and in schools.

I attended a workshop for kids and they used pre-programmed arduinos to integrate into cardboard creations. They did not program them as the kids were young and it was only a 2 hour workshops BUT

I did see they seemed to have a basic code block custom webapp. I was wondering if this was easy to do...?
I am making my own custom PCB board with clear labels for the connectors like for example SERVO 1, SERVO 2 - so kids can easily connect....I would love some custom blocks so my kids could do when push button 1 pressed SERVO 1 moves 45 Degrees.....something like that?

Is this at all possible? Or would it be a huge and very expensive project?

Yes, just keep them stupid. Even kids outgrow this level of "programming" within a few day, worst weeks.

Define "expensive". Is 10k "expensive"?

As I understand it, block programming means something other than the arduino IDE. It comes down to the customizability of that block programming app.

Options as I see it are are:

  1. The 'blocks' of your block programming thing directly generate arduino C code. The block programming IDE generates a C-language sketch when you hit 'go' and that sketch is compiled by the usual arduino toolchain.
  2. The block programming language psudeocode is executed by a an interpreter onboad in the arduino
  3. The block programming language generates something in the nature of an array of data and that array of data is executed by a software machine.

Both 2 and 3 require a fair bit of Computer Science background. The easiest way is probably route 1.

My steps would be:

  1. get your block programming IDE to generate a blank sketch with a setup and loop, compile it using the command line toolchain, and upload it.
    That is: get your string across the canyon.
  2. Actually, no. The block programming IDE would generate a C functions named block_setp and block_loop or something in a separate file bloks.cpp, and that would be compiled and linked in to your main function
extern void block_setup();
extern void block_loop();
void setup() {
  do_my_setup();
  block_setup();
}
void loop() {
  do_my_loop_housekeeping();
  block_loop();
}
  1. The basic pattern is: decide what a block should do, write a function on the arduino to do it, maybe some global variables, and get your IDE to generate code to call that function.
  2. The more I think about it, the nastier this gets. We probably don't want a loop() at all if we are just doing an intro to programming, if we just want to introduce kids to a sequence of commands that terminates. Once we put a loop in it, we necessarily have to start thinking about state in variables.
    4.1. Which is to say, what's the hardware model? What kind of things can a servo do? Are we going to have some event-driven thing? Do something when a button is pressed? In that case, we do need a loop().
    4.2. What does this block-coding IDE look like? Does it support having multiple different blocks floating about, that you can tie down to different events?
  3. Yeah, it's a fairly big job.

Maybe start from the other end?

  1. What hardware this robot of yours will have?
  2. What things will the coders be able to do with that hardware?
  3. What will coding look like in the IDE? That is, make some blocks that do nothing yet, and decide how the coder will mess with those blocks to accomplish some effect.
  4. Then get an idea of what back-end support/glue code you are going to need.

Rather like the New Math, the irritating thing is that educators are just guessing about how best to teach a thing, and the methods they have invented have little to do with how people for decades (centuries, in the case of math) have actually learned to do that thing. Weird methods of doing arithmetic to teach underlying concepts about set and group theory, with no evidence that these methods are actually going to teach anything, when how people in the past have learned those concepts is by learning arithmetic and then noticing the generalisations.

Anyway. Could be a weekend project, could be a major thing taking weeks or months.

  1. Nail down what you want the hardware to do
  2. Investigate what you can do with the block software and language
  3. …

"Scratch" has an arduino target included. Natively it "compiles" to python.