Connections to Raspberry Pi?

The Wemos IO pins can't handle a lot of current.

If you need the strobe to be really bright, you can drive it with the output of the motor control board to allow a higher peak current.

You'll probably want to have the board control the flash timing for greater precision. I;n guessing that the USB-serial connection introduces enough timing jitter that you won't see the horse in the same place every flash if you try to time the individual flashes from Snap! But the solution is easy -- Snap! can send the desired frequency to a program running on the Wemos and that program can generate the actual flashes.

This sounds like a good project to begin exploring use of Snap! to talk to MicroBlocks on the Wemos.

Did a little mod to my Microblocks to add flashing a LED at same time as controlling a motor
[minor edit 20Jul22]

image

@jmaloney @cymplecy We have begun to work with the International Technology and Engineering Education Association (ITEEA) on some projects that involve motor control, etc. ITEEA uses the micro:bit in other projects such as Project ExCITE (with Tony Gordon as P.I. and bh as a consultant).

Since there is a version of MicroBlocks for the micro:bit, would the method of using micro:blocks on the micro:bit to talk to Snap! on a Chromebook or PC work in the same way that it does for the Wemos?

John will probably expand on this answer but the microbit is a different (and more expensive) beast.

It doesn't have WiFi so that avenue of control is denied to you

Add on boards are generally not cheap but there are many different suppliers in the market

The affordability of the Wemos is why we're interested in using it for own work. Since ITEEA has already acquired micro:bits for Project ExCITE, that is a sunk cost for them. We have tried the method that ITEEA has developed for controlling the micro:bit through Snap! and it seems to work:

However, the Project ExCITE method depends upon a server maintained by Hofstra University. Hofstra has committed to maintain the server for three years. We would be more comfortable if the sole connection from Snap! to micro:bit were not dependent upon a server maintained by a university. Also, the external links make that aspect a black box.

International Technology and Engineering Educators Association (TEEA), the professional association that teamed with Hofstra to develop the ExCITE project and its materials, are to take over the work of the ExCITE project (which sunsets in September 2022) from January 2023. The will provide access to all the ITEEA connectors materials, Snap! block libraries, HEX files, etc. from then onwards. They will maintain the materials indefinitely. As now, the materials will be available at no cost for non commercial usage.

@rrwagner @excite Roger Wagner was able to use the new hex file that you provided to connect to the micro:bit. However, he reports, "I cannot turn pin 12 off, and it's not evident why that would be."

Any suggestions about how he might go about resolving this issue?

But not for schools that want to start using the ExCITE curriculum materials!

ALL curriculum, software and documentation is (and always will) be free for non-commercial use (just like BJC!)

Don't know of any projects that provide free hardware indefinitely ... please point me to one: I want to sign up!

The ITEEA block library doesn't use pin 12. It reads/writes (digital) pins 0-16 omitting 12.

I wasn't criticizing ExCITE! I was telling Glen that the possibility of using cheaper hardware is still relevant for ExCITE even though it bought hardware for the research with the first two rounds of teachers.

Our Wemos microcontroller arrived, so we're planning to try Simon's method of using MicroBlocks to communicate with the Wemos with Snap! We should know if we're able to replicate that later today.

If that works, we hope to use the same method to talk to the micro:bit (i.e., install MicroBlocks on the micro:bit and use that installation to talk to Snap!). It is exciting to have so many options,

@clymplecy We've gotten a couple nodeMCU boards, but I'm having trouble getting the computer to recognize them at a COM port. Which driver are you using? I'm finding conflicting information online regarding what I should be using.

Mine shows up as Silicon Labs CP210x
image

IIRC I installed them using

(I'm on windows)

Thanks @cymplecy. For some reason, my desktop computer isn't recognize the device, but I was able to install the drive using my laptop (both Windows 10), and the nodeMCU is showing up correctly in Device Manager there.

The board also appears for MicroBlocks, though attempting to connect to it results in a "Could not open serial port" error message. I'm going to dig deeper on the forum and in the MicroBlocks documentation to troubleshoot.

Been there done that :frowning:

Probably going to have to switch off and on 3 times - try all other USB ports - sacrifice small animal!

Bliddy computers!!!!!!

I am delighted to report that thanks to John Maloney's excellent instructions, we were able to install MicroBlocks on the micro:bit and use Snap! to control the micro:bit pins with no difficulty.

Once we are able to get the serial port on the PC to connect with the Wemos microcontroller, we should be able to do the same with it. (Thanks, Simon.) However, we didn't realize that animal sacrifice was required ... not sure how that's going to look in the Institutional Review Board (IRB) review.

You can check the exact hardware id of the USB chip used by the board.
Looking at the device record (unknown device or newly added) in the Device Manager, Details, Hardware ID property, you can see the VID & PID.
Example of CH340, localized Win10
CH340
Then search for those values to find appropriate drivers.

Factory default
CH340 => VID=0x1A86, PID=0x7523
CP210x => VID=0x10C4, PID=0xEA60

Some cloned boards may require "reset" right before flashing the MB runtime.

Success! We were able to use regular Snap! 7 to control a micro:bit with MicroBlocks to drive a linear motor. Here's a ten-second video clip:

In theory this could work with any microcontroller compatible with MicroBlocks. Thanks to @jmaloney (and jens) for creating MicroBlocks, and to @cymplecy for his tireless efforts to create a pathway enabling us to understand how this is done.

Using regular Snap! to control a motor and other physical objects is the holy grail for us. The implications are that students and schools could have access to a wide range of microcontrollers at a price point and capabilities that best meet their needs, and use the Snap! that they use for everything else. MicroBlocks does have to be loaded onto the microcontroller, but we found the directions provided by @jmaloney to be straightforward and easy to follow.

Thanks to everyone who contributed to this thread ... this will make a significant difference in what we teach and how we introduce it this fall.