Need some help seriously..

Hi guys..

I've done a short program for transmission of a certain character.

if (Serial.available() > 0) {

        incomingByte = Serial.read();

                if ( incomingByte == 49 ) // 49 is ASCII for 1
                {
                    Serial.println("Stabilize mode activated");
                    //MORE PROGRAM HERE//
                }
}

So for the above program, I am suppose to include this reading and writing program into the Arduino 2_7 code so that if a certain number is pressed, the stabilize mode will be activated.

From the AP_Config.h, it shows,
#define POSITION_1 MANUAL // the default, don't bother changing.
#define POSITION_2 STABILIZE
#define POSITION_3 FLY_BY_WIRE_A

So, i am thinking that is it possible to like read the incoming program and check whether the character is the correct one, if yes, stabilize mode will be activated, else back to manual.

If this is possible, where should i add the reading and checking lines?
I tried different ways to include and they don work.

And in this part of the program, i don have to use any ground stations or gps. just dealing with the incoming byte so that i can toggle if the byte is correct..

So if there is any example or similar programs out there, please tell me or give me any suggestions about where can i write these reading of incoming byte lines.

Thanks..
Darren..

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

This reply was deleted.

Activity