Raspberry Pi Cryptocurrency Ticker!
DIY cryptocurrency ticker using a Raspberry Pi
I posted my side projecton the NEO sub reddit a few weeks back. I got a great response from the community and had a lot of people ask for a guide and source code - so here it is!
Basically it's web app that cycles through live prices of BTC, NEO, GNT, OMG, IOTA and VTC but you can add any you like (if listed on Coinmarketcap). Here is a video of it in action
This is only a rough guide so feel free to tailor it to your needs. It's basically a web app using JavaScript to make API calls to coinmarketcap.com to pull coin details. You can run it on a TV, tablet, laptop - whatever has a browser capability.
(Disclaimer - I don't pretend to be an expert programmer and the code is likely not up the the highest standard. But hey, it works!)
Part list:
- Touch Screen 5 inch LCD This the exact one I bought as it came with a case and stand
- Raspberry Pi Model 3 The model 2 is compatible but the model 3 HDMI connection has a neater finish and has built in WiFi.
- SD card (any class 10 card will do the trick)
- Micro USB charger (at least 1500mA)
Raspberry Pi Setup:
- Install Raspian on the SD card - Official guide/download can be found here
- Install the display drivers - If you are using the display from the parts list the official guide/download can be found here
- Download the code from here and unzip the files into a sensible location on your Pi e.g. /home/piticker
- Assemble your case and connect the display to the raspberry Pi using the 40 pin connector, connect the HDMI and power it up. At this point you should have a functioning Raspberry Pi, woo!
- Connect the Pi to a WiFi network.
- Open terminal on the raspberry Pi and type the following command to launch the Chromium browser with the web app in fullscreen mode.
chromium-browser --app=<e.g. home/piticker/index.html> --start-fullscreen
- Optional - You can modify the Pi's boot files to auto launch the web app on boot. Guide on doing this can be found here
Adding / customising more coins:
Open up file
ajax.scripts.js
in a text editor
The code snipping if for gathering prices from coinmaketcap.com - feel free to edit the following code to whichever coins you like. Modifying the values in bold to change coin - API documentation
$.ajax({
url: "https://min-api.cryptocompare.com/data/price?fsym=OMG&tsyms=BTC,USD"
}).then(function(data) {
$('.omgusd').empty().append(data.USD); //HTML class in index.html to display USD value
$('.omgbtc').empty().append(data.BTC); //HTML class in index.html to display BTC value
});
Thanks for reading! Any questions feel free to drop a comment below.
Reference AnySlider by jwilsson (the code for the sliding effect) - https://github.com/jwilsson/AnySlider
Feel free use and abuse under MIT licence - please reference my Steemit post if you do.
@cryptotaylor, welcome and congratulations on making your first post! I gave you a $.05 vote! If you would be so kind to give me a follow in return, that would be most kind of you!!
Woohoo thanks!
Great project and first post. Welcome to steem!
Thank you!
Congratulations @cryptotaylor! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Do not miss the last post from @steemitboard:
Vote for @Steemitboard as a witness to get one more award and increased upvotes!