View Single Post
Old Nov 11, 2012, 07:46 AM
XDreamer is online now
Find More Posts by XDreamer
Registered User
Joined May 2010
117 Posts
Quote:
Originally Posted by Dennis Frie View Post
Yup, unfortunatly the entire code is quite a mess and pretty hard-coded. I never expectged that anyone but me should look at the code - sorry guys
You are my hero anyway.

I'm planning to simplify the code, as I have made to many copy-pastes and have lost track of what is what. I started with the source from El_Nono in this post: http://www.rcgroups.com/forums/showp...postcount=1758
And his spanish comments / variable names did not make it any simpler. But Google Translate helped me.

I will post a zip with my OSD code soon, I will just clean it up a little bit.

In the future I'm thinking of something like this:
Code:
if (line >= line1Start && line < line1Start + line1Height) {
    printTimer(line);
    delay(20);
    printHomeArrow(line);
    delay(20);
    printBattery1Voltage(line);
}
else if (line >= line2Start && line < line2Start + line2Height) {
    printGpsCoordinates(line);
    delay(20);
    printBattery1Current(line);
    delay(20);
    ....
}
And text could be written like this:
Code:
printText("HELLO");
Of course, this could be impossible with the timing restrictions and the slow Arduino.
XDreamer is online now Find More Posts by XDreamer
Reply With Quote