Drive step motor from scratch

Dear customers,

We created a small demo “how to drive a step motor from scratch”

Scratch is a development environment from MIT to learn to program. All programs are open source. For this reason you can very easily copy and share the programs. To get the demo running, press the green flag in the scratch environment after you clicked on the link above.

Scratch does offer options to communicate with the outside world but this requires advanced computer science. For educational purposes we created a small program called “color communication” to drive a step motor using the computer sound card. The “color communication” program looks at 3 positions on the scratch screen to see if a color changes. If the color changes from red to green, the step motor starts. Because we look at 3 location, we have 3 bits (and we probably all know that a bit can be on or off).

Flipping bit 1: Step motor makes 100 steps
Flipping bit 2: Step motor makes 1000 steps
Flipping bit 3: Step motor makes 10000 steps

You can also put a color communication point of interest at the rotating heart. Then your step-motor runs with the rotating heart frequency.

Thus by means of scratch and “color communication”, you (or your children) can move a step-motor with minimum effort. This is important because your children will become the future box joint specialists.

scratch color communicator

For those interested, you have to follow these steps:

Now do you really need the color communicator ? Of course not. We drive the step motor by means of sound. Thus you can copy the .wav files directly into scratch as an event that happens when one clicks a button.

Also note that we have added Jointmaster PRO to the shop . Jointmaster PRO is a extremely reliable Windows USB solution so that you can:

– drive up to four step motors.
– read and process G-code. GCode is exported from blender (open source 3d modeler) using the blender CAM module.
– automatically home your step motor.
– read stop-switches status (step motor is stopped automatically when a stop-switch is hit.)
– turn direction by means of software.

And yes, if you would like to drive this USB solution from Scratch then you would need the color communicator (or a more difficult interface via javascript). The only thing you will not be able to do by means of the color communicator is reading the stop switch status because you cannot communicate color back to Scratch.

 

 

 

 

Leave a Reply