micro:bit Projects: LEGO Power Functions IR Sender @microbit_edu #microbit #microbitlove #microbitmonday

From Philipp Henkel via hackster.io

We experimented with visual programming languages and we love colorful interlocking plastic bricks. The desire to control a LEGO® train using a web-based, visual development environment was born.

We started with a Scratch and Arduino based solution. We had a working prototype that proved to be error-prone and complex in the setup.

In our second approach, we used the German sibling of the micro:bit. The Calliope board comes with a motor driver which reduced the required hardware to the board itself and some home-made connection cables. Our first field test with a LEGO® model failed tremendously. The test revealed that we want to fully control at least two motors and lights. The more the better. The Calliope is limited to one motor.

Finally, we built a custom package for MakeCode that enables a micro:bit with an attached infrared LED to send commands to a Power Functions IR receiver – like a remote control. Now we were able to control multiple devices with minimal hardware requirements and provide easy-to-use programming blocks in addition.

We published our package on GitHub at http://ift.tt/2kwrPU7. Please raise an issue there if you have any problems.

You need basically two things: a micro:bit board and an infrared LED that emits IR light at a wavelength of 940 nm. Any IR LED from an old remote control will probably do the job. We tested with SFH 4546 and TSAL 6200. We attached the LED with banana connectors and female jumper cables. The long leg of the LED needs to be connected to an analog pin. We recommend pin 0 because this one is configured as default in the MakeCode package. Plug the LED’s short leg into GND.

Full project writeup here!



from Adafruit Industries – Makers, hackers, artists, designers and engineers! http://ift.tt/2yolu0w
via IFTTT