Author Options:

Arduino Code Modification Help (Change of Display Type Used) Answered

This is my first post, so I hope I'm doing this correctly.

For reference, I'm new to Arduino, and with no experience with code.

I want to try and do a battery tester with an Uno, as seen here (http://denishennessy.com/2012/04/08/measuring-battery-capacity-with-an-arduino/). I'm trying to follow the instructions given, and use the code (https://github.com/dhennessy/BatteryCapacityTester/blob/master/BatteryTester/BatteryTester.ino) that the author has provided. However, due to lack of availability of parts, I don't have a temperature sensor, and instead of the 16x2 LCD screen, I have an Adafruit 1.8' TFT shield.

So my query is, how can I modify the code such that it works on this type of display? Again, the code is from (https://github.com/dhennessy/BatteryCapacityTester/blob/master/BatteryTester/BatteryTester.ino), and I have not directly copied it in the post so that it is easier to read.

Any help on this would be greatly appreciated.


You should look at adafruit's support for your TFT Shield. The GFX library code to include as "drivers" does have a serial print text function. You should be able to substitute/replace the specific code part for printing on the other display. I saw some other tutorial on datalogging a coin cell usage there so you may want to display it graphically by adapting that code to your display. Good luck.

That would require a complete rewrite of the code. You should start with something simpler and work your way up. Work with the display you have. Run through the example sketches that come with the library and learn how that all works. Better yet start at the beginning and learn the basics of the C language.