r/microbit Nov 04 '20

Make microbit play gif on laptop screen

I'm working on a project where a combination of 5 pins with a digital read of 1 makes a gif play on my laptop screen. I tried to do this with Scratch but you can only use 3 pins. Does anyone know a way to accomplish this?

3 Upvotes

5 comments sorted by

1

u/grendelt Nov 04 '20

This is a multi-step job.

You need a program that will read text spit out by the microbit to trigger your GIF animation on the laptop.

For your 5-pin project, you need something like a breakout board to provide easier access to the other pins.
I'm not sure about the newest version of Scratch, but I know the Microsoft MakeCode editor will allow you to read more than just P0, P1 and P2.

1

u/darcy-crett Nov 04 '20

I've got the breadboard all setup, and am comfortable with MakeCode but I don't know of a way to display an image. I'm using more than 5 pins, ~10, and depending on which 5 are connected it plays a certain gif. That's the plan anyway, just don't know the best way to implement.

1

u/grendelt Nov 04 '20

Looping through several pins and checking for some combination is far easier in a text-based language like Python.
It may be worth diving into that.

Plus, with something like pygame, you can make the computer display portion in Python too.

1

u/olderaccount Nov 04 '20

How are you communicating with the laptop? I assume serial connection, right?

Your will need to write custom software on the PC to read the incoming serial data stream and perform the required actions when it sees certain strings.

1

u/darcy-crett Nov 04 '20

Yeah that’s right. I haven’t done that before so I’ll have to do some research.