Presentation is loading. Please wait.

Presentation is loading. Please wait.

If (UCSRA & 0x80 ) { switch(ch) case ‘u’: while ( aileronleft > 1) { lcd_clrscr(); lcd_gotoxy(1,0); lcd_puts("SW1 depressed"); x = x - 4; if ( x < 1000)

Similar presentations


Presentation on theme: "If (UCSRA & 0x80 ) { switch(ch) case ‘u’: while ( aileronleft > 1) { lcd_clrscr(); lcd_gotoxy(1,0); lcd_puts("SW1 depressed"); x = x - 4; if ( x < 1000)"— Presentation transcript:

1 if (UCSRA & 0x80 ) { switch(ch) case ‘u’: while ( aileronleft > 1) { lcd_clrscr(); lcd_gotoxy(1,0); lcd_puts("SW1 depressed"); x = x - 4; if ( x < 1000) {x=1000;} ServoPos[2]= x; _delay_ms(100); break; } AVR Program Side Register that holds the received data Aileronleft = 2; in the earlier part of the program. Continued case ‘o’: aileronleft =0; break; }

2 VB Side Private Sub btnaileronleft_MouseDown(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnaileronleft.MouseDown Dim answertext As String answertext = "u" mscomm.Open() mscomm.Write(answertext) mscomm.Close() End Sub Private Sub btnaileronleft_MouseUp(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles btnaileronleft.MouseUp Dim answertext2 As String answertext2 = "o" mscomm.Open() mscomm.Write(answertext2) mscomm.Close() End Sub When button is depressed

3 PC MCT Board When button is depressed, char ‘u’ is sent over. Char ‘u’ Char ‘o’ When button is being released of its depressed state, char ‘o’ is sent over. The char ‘u’ did get received. But after that, it became non responsive to other characters being sent over. After one click of the button, it was stuck in the loop and continued to move the aileron till its limit. I had to reset the board if I were to test the other buttons. This case happens for the other buttons, for example aileronright, elevator, etc.

4 Data is transmitted over from PC

5 Data Transmitted - Characters Used Control surfacesMouse downMouse up Aileron leftuo Aileron rightvp Elevator upwq Elevator downxr Rudder leftys Rudder rightzt


Download ppt "If (UCSRA & 0x80 ) { switch(ch) case ‘u’: while ( aileronleft > 1) { lcd_clrscr(); lcd_gotoxy(1,0); lcd_puts("SW1 depressed"); x = x - 4; if ( x < 1000)"

Similar presentations


Ads by Google