There are many solutions for OS X Yosemite (open source, free or paid apps) to stay up to date with the latest BTC/USD exchange rate (the list to the Github repos can be found below). I wanted a simple solution that I can hack in a few minutes on a lazy Sunday night. The solution is a simple Today widget. To get the result in the shot below, continue reading.
All you need is Today-Scripts (a simple OS X app that allows you to run shell scripts in your Today bar) and a small Python script and you’re set. Follow these instructions get the desired result:
Download the latest build of Today-Scripts (latest build) or if you prefer, compile your own version from source code (Github Repo)
Create a new python script (anywhere) from the following gist (get_data.py). The scripts calls the Coinbase REST api to get the latest price.
Using Today-Scripts select the ksh shell and specify the python interpreter to use followed by the script’s absolute path (if you find a more elegant solution for this, drop a line in the comments section below)
As I was working on a project that makes use of the Sparkfun color LCD shield I noticed after running sample code that the back-light is not working properly. Adding to that, it was a bit challenging to find Arduino (v1.0) compatible libraries to make this shield work as it was intended. The solutions for these 2 problems are summarized below.
Credit is due where credit is due. The original hacker who, with a bit of research and reading a few comments on the product’s page, found the solution can be reached through this link. Although the description of the fix is quite straight forward, I though it could be simplified more.
The problem relies in a resistor on the board (R1) that was supposed to have the value of 15KOhm but was (for some reason) replaced with a 3.3KOhm resistor (as shown in the picture below).
In order to resolve this issue and provide enough voltage to activate the back-light, this resistor needs to be short-circuited by soldering the edges of 2 components as shown in the picture below. A small solder drop is enough to provide you with an elegant fix.
That should do it.
Libraries compatibility problems
I naively assumed that upgrading my Arduino IDE to version 1.0 would not break any existing library, however as it turns out it does. The libraries that enable the color LCD shield do not work with v1.0. The libraries that are available either use “WProgram.h” or “wiring.h” header files which have been merged in the new version of the Arduino IDE with the “Arduino.h” header file. In addition, replacing these header files with “Arduino.h” does not seem to fix the compilation error.
So in order to avoid hours of pain, Arduio IDE v0023 runs the LCD shield libraries perfectly well.