Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How to Hook up LCD (http://www.chiefdelphi.com/forums/showthread.php?t=55202)

magical hands 04-03-2007 11:47

Re: How to Hook up LCD
 
Hey Dave thanks for sharing that info its really amazing. Thats exactly what I am planning on doing with my Tablet, I don't want to use the IFI's Dashboard. or infact use it but have more features to it example it shows ur gyro angle and GTS tooth count, camera values etc. So Dave would the process be still the same for tablet? the fact that I would have to create a cross platform between what Dashboard recevies and what info shows up on my tablet? and what programming language do you prefer this platform to be made in? V.B? C? C++?

Dave K. 04-03-2007 12:28

Re: How to Hook up LCD
 
Quote:

Originally Posted by magical hands (Post 589936)
Thank you very much everyone. This post has been really helpful to me. Thanks Mark for sharing your code. The purpose of this LCD is to check the flow of current in our robot, check robot's current angle and distance travelled which is monitored by Gear Tooth Sensor and Gyro. However, the LCD adds the cool factor to the control system. Since its difficult to attach this LCD to the Operator Interface. Now we are planning on attaching a tablet to the OI and have it setup up so the drivers can see all motor values, gyro value, gear tooth value and infact they can precisely control the robot by looking at these values. Also, it helps in troubleshooting our autonomous after every game because we will have record of what went wrong where. So ya!

Is it possible I can change between the two codes in my robot? for example a default code and camera code in robot without downloading back and forth? So I can have control over which code will be used during each game just by flicking some switches on and off?

If you have some unused Digital I/O inputs, configure one or more of them to control which 'code' runs.

Code:


unsigned char whichone = 0;

    if (rc_dig_in 14)  whichone |= 1;
    if (rc_dig_in 15)  whichone |= 2;
    if (rc_dig_in 16)  whichone |= 4;

    switch (whichone) {
        case 0:  {
              // run this code
        }

        case 1:  {
            // or run this code
        }

        case 2: {
            // and so on...
        }

        default: {
            // just in case...
        }
    } // switch

On the digital inputs just make up some jumpers, or install some switches between the digital input and ground. You might want to avoid using miniture switches that might be jarred during competition.

Dave K. 04-03-2007 12:53

Re: How to Hook up LCD
 
Quote:

Originally Posted by magical hands (Post 589939)
Hey Dave thanks for sharing that info its really amazing. Thats exactly what I am planning on doing with my Tablet, I don't want to use the IFI's Dashboard. or infact use it but have more features to it example it shows ur gyro angle and GTS tooth count, camera values etc. So Dave would the process be still the same for tablet? the fact that I would have to create a cross platform between what Dashboard recevies and what info shows up on my tablet? and what programming language do you prefer this platform to be made in? V.B? C? C++?

If you search a little here on CD you'll find previous discussions and pointers on dealing with the dashboard data. Included with IFI's dashboard download you should find their documentation on the serial protocol.

In short, each frame consists of 26 bytes, with the start of the frame consisting of 0xff 0xff. There are three frame types, and you need to look at bits within control bytes to figure out which frame of data you've just received.

The 'dashboard' port is simply the raw data from either the RC->OI OR the OI->RC, the shunt near the connector controls which half of the conversation you are monitoring. The bit rate is 19200.

Remember, this is the raw, unchecked data passing between the OI and RC. There are two "checksum" bytes in the middle of the packet that the RC and OI use to determine whether the packet was good or whether it was corrupted.

For some odd reason, IFI won't document the "checksum" works, and I guess once you know how it works, we aren't supposed to reveal their "secret".

I suppose for just displaying data, data from an errored packet will be quickly replaced by good data and any resulting 'glitch' will probably go un-noticed by the end user. If you use the 'user' bytes to multiplex more data at a slower speed, then understanding how the "checksum" works becomes more important.


As far as the language choice, VB, C, C++, Delphi, will all work fine. It is more a matter of which platform and compiler you are most comfortable and experienced working with.

magical hands 04-03-2007 13:18

Re: How to Hook up LCD
 
Thanks Dave that was really helpful! :) I hope I succeed in my mission.


All times are GMT -5. The time now is 19:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi