Controlling 2 LEDs and one Servo via VB6
karabet
Posts: 17
Hi,
Please i need help, I’m trying to control 2 LED’s (ON/ OFF) and one Servo but I’m having the following problem.
If turning on for example LED1 and try to turn it off it will not go off and it is the same for LED2, but if i remove the servo part (code) it will work fine.
I’m connecting LED1 to P9 and LED2 to P13 and the Servo to P0.
Please find attached the complete code
here's the VB code
PLEASE HELP...........
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
Post Edited (karabet) : 3/5/2010 7:48:06 AM GMT
Please i need help, I’m trying to control 2 LED’s (ON/ OFF) and one Servo but I’m having the following problem.
If turning on for example LED1 and try to turn it off it will not go off and it is the same for LED2, but if i remove the servo part (code) it will work fine.
I’m connecting LED1 to P9 and LED2 to P13 and the Servo to P0.
Please find attached the complete code
here's the VB code
PLEASE HELP...........
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
Post Edited (karabet) : 3/5/2010 7:48:06 AM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
i did upload the VB code
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
·
PS. Syncbyte is just the possible positions
Private Sub Timer1_Timer()
syncbyte = 255
servo = val(textservo.text) ‘servo # OR PIN # in your case
position = VScroll.value
txtposition.text = position ‘position you intend for the servo
mscomm1.output = chr$(syncbyte) & chr$(servo) & chr$(position)
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Regards,
Karabet
·