View Single Post
Old 12-02-2010, 04:24 PM   #4068 (permalink)
Greg Fordyce
EcoModding Lurker
Join Date: Nov 2009
Location: Scottish Borders, Scotland
Posts: 92
Thanks: 7
Thanked 33 Times in 16 Posts
4dsystems touch screen display.

Back to the topic of a touch screen graphic display. I have been looking at the products from 4D Systems, an Australian company, and today ordered one of these µLCD-32PT(GFX) - 4DGL Display Modules. I have mentioned this product before, so while I am waiting for it to arrive I thought I would start writing some code for it. They have an IDE, free to download, and the language is kind C like but optimized for doing tasks such as displaying graphics and parsing serial data strings, perfect for what is required for this project. The first goal is to read the real time data stream from the controller and display the information on the screen. I have a couple of questions about the data stream.

First, what is the formula to convert the temperature data to Celsius and Fahrenheit. Second has to do with the fault bits. I found this in the cougar.h file, but can't work it out.

#define THROTTLE_FAULT (1 << 0)
#define VREF_FAULT (1 << 1)
#define PRECHARGE_WAIT (1 << 5)
#define MOTOR_OS_FAULT (1 << 6)
#define HPL_FAULT (1 << 7)
So what is the values for the above faults, and can the controller set multiple faults at the same time?

I will post the code as and when I get something cobbled together. The next goal will be to have an interface to change controller settings. Another idea is to have a programmable preset memory like a car radio has. Maybe have 3 possible settings, say economy, normal and sport. Just press a button and the controller can be updated with the new settings. Also could be useful for testing new settings, you can save your current setting and always be able to revert back at the touch of a button.
  Reply With Quote