Steam Train powered by the Steem Chain

in #steemhacks5 years ago

Previously I hooked up a giant whale to the Steem blockchain (currently in wintersleep), but today I found out that the Duplo Steam Train we gave as a Xmas gift to our son, actually has BLE (bluetooth low energy) so I wanted to see if that could be programmable! And of course I wanted it to work with the Steem chain :)

roelandp-on-the-steem-train.jpg

Now it happens to be that there are already many fans building stuff on top of Lego and Duplo peripherals and they all gather on the Eurobricks forums.

This is where I found out that Nathan had already written a Node library which handles all the barebones (bluetooth connection, communications layer) for talking and pushing and receiving events from the Duplo train.

Putting my script together was as simple as hooking Nathan's library together with the dSteem library by @almost-digital and voila... A Steam Train powered by the Steem Chain.

How it works


The node script connects to the Bluetooth of the Duplo Train. As soon as a connection is established, the script will start connecting to the Steem blockchain and streaming blocks as they are pushed to the chain.

Whenever a new block arrives, the script has the light of the train's bumper blink and checks the amount of transactions in the block. If the amount of transactions is higher than the avarage transactions per block, it will speed up the train. If the amount is lower than the average, it will slow down the train.

As a gimmick I also added the "choo choo" whenever my witness @roelandp signs a block.

Here is a demo video


Sources / Links


Wishing you a great 2019, may you have a prosperous year and have a great NYE!

See you on the chain
@roelandp

If you like what I do, consider supporting my witness @roelandp

Sort:  

Wow! This is simply amazing buddy. Pure engineering ingenuity. Cool!

Happy new year from here

It's time someone pushed the steem/steam connection to it's logical train-y conclusion :D

Youre programming leggo now??? I think i still am in 2017. Anyway happy happy new years eve!

That was pretty cool. :D

Ha ha, that's so cool! Hopefully you have it in the back room so the train doesn't keep you awake at night. Although the lack of "choo choo" could be a clever way to alert you if your witness is having issues.

:p today it ran out of battery :) plus my son wanted to play with it again. i found out it has a whistle too with 5 tones so i might find some way to play simple songs on it :)

If the battery ran out, then at least we know the Steem blockchain didn't stop.

That's just rude of your son to want to play with a toy that you got him when you're already playing with it. Ha ha. :)

You are really cool sir @roelandp always keeping this journey sir

Posted using Partiko Android

Hi @roelandp!

Your post was upvoted by @steem-ua, new Steem dApp, using UserAuthority for algorithmic post curation!
Your UA account score is currently 8.488 which ranks you at #4 across all Steem accounts.
Your rank has not changed in the last three days.

In our last Algorithmic Curation Round, consisting of 204 contributions, your post is ranked at #1. Congratulations!

Evaluation of your UA score:
  • Your follower network is great!
  • The readers appreciate your great work!
  • Great user engagement! You rock!

Feel free to join our @steem-ua Discord server

Woow woow... totally insane. I truly believe that activate real machines using the chain is a game changer.
And by the way the whale was fantastic and now the choo choo? - what to say man...?

What about free sweet dispenser machines? :)
Love and a mad 2019!!!!

Peace V!

Pure class! What a great mini-project to work on and showcase blockchain technology in the quirkiest of ways! (again!). All the best for 2019 to you and the family......look forward to seeing what you bring to the chain in the new year......

thabks! and to you! have a great 2019!

@roelandp this is so cool man!. how
long did it take you?

Posted using Partiko Android

tbh it took me longer to cut the video :) and i was fiddling around a lot with the duplo library as it has other cool features onboard the train such as a color sensor, speedometer and distance meter. toys are not what they used to be these days haha

Wow, this is really cool! Not quite as awesome as the Steem whale fountain you made a while back, but still amazing. The funniest part for me is that my 2-year old child got one of these Duplo trains for Christmas a few days ago, so now I'm tempted to learn how to build stuff on top of it :P

haha cool :)

if u have a mac its really as simple as copy pasting my script, installing dsteem and the other linked package and running it!

Coin Marketplace

STEEM 0.20
TRX 0.13
JST 0.029
BTC 60924.19
ETH 3382.45
USDT 1.00
SBD 2.54