g

Dependencies:   MODSERIAL mbed Encoder

begintotaalscript.cpp

Committer:
Esther
Date:
2013-10-31
Revision:
0:e9e50c0a6502
Child:
1:8a0a39740897

File content as of revision 0:e9e50c0a6502:

#include "mbed.h"
#include "MODSERIAL.h"


int main()
{

    MODSERIAL pc(USBTX,USBRX,64,1024);
    pc.baud(115200);


    DigitalIn knop1(PTC2);
    DigitalIn knop2(PTB3);
    DigitalIn knop3(PTB2);

    knop1.mode(PullUp);
    knop2.mode(PullUp);
    knop3.mode(PullUp);

    int state = 1;

    while (true) {

        if (state == 1)
            pc.printf("state 1 rust| 1=cal motor 2=cal emg 3=tekenen /n/r");

        if (knop1 == false ) {
            state=2;
            wait(0.05);
        }

        if (knop2 == false ) {
            state=3;
            wait(0.05);
        }
        if (knop3 == false ) {
            state=6;
            wait(0.05);
        }
        



        if (state == 2)
            pc.printf("state 2 cal robot| 2= rust /n/r");
        if (state == 3)
            pc.printf("state 3 cal EMG | 1=cal emg laag 3=cal emg hoog /n/r");
        //if (state == 4)
          //  pc.printf("state 1 | 1=cal motor 2=cal emg 3=tekenen /n/r");
        //if (state == 5)
          //  pc.printf("state 1 | 1=cal motor 2=cal emg 3=tekenen /n/r");
        if (state == 6)
            pc.printf("state 6 tekenen| 6=rust /n/r");

    } //sluiten oneindige while loop

}//afsluiten main