Good news, my Yun has arrived. I am not quite ready to move on to the internet side of my project, but it nice to be able to see what I am working with. On the minus side, the Ups shipping notification arrived two days after the Yun, but thankfully I was at home on the day that it arrived so there were no problems with the delivery.
And now onto my progress. Having determined that the screen could be driven from 5v, my first step was to try and power it from the Uno. The minimum safe resistance on the io pins of most Arduinos is around 200 ohms, so to test the display I wired a 220 ohm resistor in series with it, and hooked it up to the Uno. My original plan to test the display was to use a serial terminal to communicate with the Arduino so I could change PWM values on the fly to work out the correct values for this display, but the code I uploaded for a test uploaded so quickly compared to the sketches on my Leonardo that I decided just to use a simple analogue write and change the value and re upload each time. This could damage the chips memory over time, but I wanted to take advantage of this new boards features the first time I used it. Using trial and error, I was able to work out display values to get the screen to work correctly. However, I had to use very low PWM values to the point that I could not get the resolution that I needed. To fix this I added a second 220 ohm resistor in series with the first and changed my PWM values accordingly to get a reasonably accurate display working. In the final design, I will use a single 470 ohm resistor, but at the time I did not feel like rummaging through my part bins for a second time. Using the new PWM values I then created a quick demo programming that moves the dial up through all the values. Some tweaking is still needed but it works reasonably well.
Now that I have the display working, it is time to think about my backlight. My original plan was a monochromatic backlight driven by a single PWM pin from the Arduino. However, now that I have moved away from the motor shield, I am able to very easily install the Infineon LED sheild instead. I am going to use the shield to implement a traffic light style indication of the number of posts from the backlight, starting green and moving through to yellow and red. Rather than an RGB led, I am going to use a separate red, green and yellow led. The In fine on shield does not come with headers installed, so I first had to solder these into place. It is worth bearing in mind that no headers are included with the sheild, I had to use the ones from the Arduino starter kit. Nonetheless, breaking apart and soldering on the headers was very quick and easy. I also used some spare headers to attach to create an adaptor to plug the outputs from the sheild into a breadboard, to a low the display to plug into the breadboard, and to add some wires coming off the sheild to more headers so I could still use the display as well as add some buttons. To power the sheild I just cut the end off a twelve volt power brick I had lying around.
The first issue I had was with downloading the example code. Strangely enough, the download from the official website required running a programming to create the correct folders. As a Linux user, this could have been an issue. Thankfully though, it was able to run under WINE with no issues. My next issue was setting the current limit. I had some issues lowering the current limit from the driver through software. Instead of fighting with code I decided just to use some resistors to ensure the current passing through the LEDs was not to high. This is a bit of a dirty fix, but for a prototype it is not to much of an issue.
Eventually I was able to modify the example code to the point where I could control the backlight. I then combined this with my previous demo programming and was able to cycle through the values on the dial and backlight. A few more modifications, and I was able to control the values with a pair of buttons. The buttons work through a variable in the code which in the final version will be updated by the number of message in my inbox. I also added the option to deactivate the backlight with a third button, which will be replaced with a switch in the final version. This is so I can have the unit in a bedroom and turn off the backlight to sleep. I have set up the light to go red quite a while before the dial reaches the end of the scale. This mostly because my inbox rarely has more than 6 messages, and I want to try and enjoy the full color spectrum available to the light system.
My next step is going to be working on the code for the internet side of this project. If anyone knows a good way to create the cookies on the Yun to log in to the site so I can parse for the message count, or has another way of getting the message count please leave it in the comments.