gpio

Based on DMP's Vortex processor / SoC this board is a full computer capable of running a standard Windows and Linux installation on the backpack of your robot.
1 postPage 1 of 1
1 postPage 1 of 1

gpio

Post by suv23 » Fri May 20, 2011 3:18 am

Post by suv23
Fri May 20, 2011 3:18 am

this is my code..

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim sensor As Integer

'motor forward
rcservo_SendCPWM(RCSERVO_PINS1, 10000, 5000) 'pwm at full speed
rcservo_SendCPWM(RCSERVO_PINS2, 10000, 5000) 'pwm at full speed
rcservo_OutPin(RCSERVO_PINS3, 0) 'output low pin 3
rcservo_OutPin(RCSERVO_PINS4, 1) 'output high pin 4
rcservo_OutPin(RCSERVO_PINS5, 1) 'output high pin 5
rcservo_OutPin(RCSERVO_PINS6, 0) 'output low pin 6
rcservo_OutPin(RCSERVO_PINS7, 0) 'output low pin 7

sensor = rcservo_InPins(RCSERVO_PINS7)
If sensor = 1 Then
rcservo_OutPin(RCSERVO_PINS3, 0) 'output low pin 3
rcservo_OutPin(RCSERVO_PINS4, 0) 'output high pin 4
rcservo_OutPin(RCSERVO_PINS5, 0) 'output high pin 5
rcservo_OutPin(RCSERVO_PINS6, 0) 'output low pin 6


Else
'motor move reverse

rcservo_SendCPWM(RCSERVO_PINS1, 10000, 5000) 'pwm at full speed
rcservo_SendCPWM(RCSERVO_PINS2, 10000, 5000) 'pwm at full speed
rcservo_OutPin(RCSERVO_PINS3, 1) 'output high pin 3
rcservo_OutPin(RCSERVO_PINS4, 0) 'output low pin 4
rcservo_OutPin(RCSERVO_PINS5, 0) 'output low pin 5
rcservo_OutPin(RCSERVO_PINS6, 1) 'output high pin 6
End If

End Sub




i want the bold code function if the pins 7 receive 5v from other source, it will off the pins3,4,5, and 6..but the code not function properly..any ideas??
this is my code..

Private Sub Button8_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button8.Click
Dim sensor As Integer

'motor forward
rcservo_SendCPWM(RCSERVO_PINS1, 10000, 5000) 'pwm at full speed
rcservo_SendCPWM(RCSERVO_PINS2, 10000, 5000) 'pwm at full speed
rcservo_OutPin(RCSERVO_PINS3, 0) 'output low pin 3
rcservo_OutPin(RCSERVO_PINS4, 1) 'output high pin 4
rcservo_OutPin(RCSERVO_PINS5, 1) 'output high pin 5
rcservo_OutPin(RCSERVO_PINS6, 0) 'output low pin 6
rcservo_OutPin(RCSERVO_PINS7, 0) 'output low pin 7

sensor = rcservo_InPins(RCSERVO_PINS7)
If sensor = 1 Then
rcservo_OutPin(RCSERVO_PINS3, 0) 'output low pin 3
rcservo_OutPin(RCSERVO_PINS4, 0) 'output high pin 4
rcservo_OutPin(RCSERVO_PINS5, 0) 'output high pin 5
rcservo_OutPin(RCSERVO_PINS6, 0) 'output low pin 6


Else
'motor move reverse

rcservo_SendCPWM(RCSERVO_PINS1, 10000, 5000) 'pwm at full speed
rcservo_SendCPWM(RCSERVO_PINS2, 10000, 5000) 'pwm at full speed
rcservo_OutPin(RCSERVO_PINS3, 1) 'output high pin 3
rcservo_OutPin(RCSERVO_PINS4, 0) 'output low pin 4
rcservo_OutPin(RCSERVO_PINS5, 0) 'output low pin 5
rcservo_OutPin(RCSERVO_PINS6, 1) 'output high pin 6
End If

End Sub




i want the bold code function if the pins 7 receive 5v from other source, it will off the pins3,4,5, and 6..but the code not function properly..any ideas??
suv23 offline
Newbie
Newbie
Posts: 3
Joined: Tue Feb 15, 2011 2:54 pm

1 postPage 1 of 1
1 postPage 1 of 1
cron