Buy an Axon, Axon II, or Axon Mote and build a great robot, while helping to support SoR.
0 Members and 1 Guest are viewing this topic.
void control(void){int temp;rprintf("\n enter the data");temp=uart1GetByte();//returns -1 if no data presentif (temp==1)//if data receivedwhile(1){servo(PORTE,4,1400);delay_ms(20);}}
void control(void){int temp;rprintf("\n enter the data");while(1){temp=uart1GetByte();//returns -1 if no data presentif (temp==1)//if data receivedservo(PORTE,4,1400);delay_ms(20);}}
We can't help if you don't tell us any information :P
void control(void){int temp;rprintf("\n enter the data");while(1){temp=uart1GetByte();//returns -1 if no data presentif (temp==1)//if 1 received{servo(PORTE,4,1400);rprintf("stuff received");delay_ms(20);}}}
char temp;while(1){temp=uart1GetByte();//returns -1 if no data presentif (temp == 'r')//if data received rprintf("stuff");}
void control(void){int temp;rprintf("\n enter the data");while(1){temp=uart1GetByte();//returns -1 if no data presentif (temp==1)//if data receivedrprintf(" entered no is 1");}}
In my first code, the axon gets input once and if that input is equal to 1, the servo runs for an infinite time.
The code example that did work used if (temp == 'r')//if data receivedwhich is expecting a Carriage Return ASCII character.