dim position as integer
dim position1 as integer
dim position2 as string[20]
dim position3 as string[20]
dim thechannel as integer
dim thechannel2 as string[3]
thechannel=0
position=5000
position1=position>>6
inttostr(position,position3)
inttostr(position1,position2)
do
inttostr(thechannel,thechannel2)
uart1_write_text("0b11100000 |")
uart1_write_text(thechannel2)
uart1_write_text(position2)
uart1_write_text("0b01111111")
uart1_write_text(position3)
uart1_write_text("0b00111111")
uart1_write_text("50")
inc(thechannel)
loop until thechannel=7
yonghui WROTE:Have try look at citron tutorial?
http://tutorial.cytron.com.my/2011/08/1 ... project-2/
Sent from my T100TA using Tapatalk
sahniana WROTE:here's my code:
- CODE: SELECT_ALL_CODE
dim position as integer
dim position1 as integer
dim position2 as string[20]
dim position3 as string[20]
dim thechannel as integer
dim thechannel2 as string[3]
thechannel=0
position=5000
position1=position>>6
inttostr(position,position3)
inttostr(position1,position2)
do
inttostr(thechannel,thechannel2)
uart1_write_text("0b11100000 |")
uart1_write_text(thechannel2)
uart1_write_text(position2)
uart1_write_text("0b01111111")
uart1_write_text(position3)
uart1_write_text("0b00111111")
uart1_write_text("50")
inc(thechannel)
loop until thechannel=7
no response = doesnt work. anyone can exlain why? by the way, i dislayed the position3, position2 and thechannel2 on lcd, and here's what i got:-
position3 = 5000
position2 = 78
thechannel2 = 50
anything wrong with my code?
gadgetng WROTE:sahniana WROTE:here's my code:
- CODE: SELECT_ALL_CODE
dim position as integer
dim position1 as integer
dim position2 as string[20]
dim position3 as string[20]
dim thechannel as integer
dim thechannel2 as string[3]
thechannel=0
position=5000
position1=position>>6
inttostr(position,position3)
inttostr(position1,position2)
do
inttostr(thechannel,thechannel2)
uart1_write_text("0b11100000 |")
uart1_write_text(thechannel2)
uart1_write_text(position2)
uart1_write_text("0b01111111")
uart1_write_text(position3)
uart1_write_text("0b00111111")
uart1_write_text("50")
inc(thechannel)
loop until thechannel=7
no response = doesnt work. anyone can exlain why? by the way, i dislayed the position3, position2 and thechannel2 on lcd, and here's what i got:-
position3 = 5000
position2 = 78
thechannel2 = 50
anything wrong with my code?
Hi, i never use mikrobasic before therefore i not really understand on your code. Maybe you should put some comment on your code so that ppl can easily understand the coding. Just to remind you that you need to activate the servo channel on SC08A everytime SC08A is power up. I checked on the SC08A's UM, you will need to send two bytes of command to activate the servo channel so that the servo will respond to you at position and speed command.
gadgetng WROTE:Since it is working with the test button, i don't think is the SC08A problem. Maybe you can try to use Arduino to test on it first.
Users browsing this forum: No registered users and 2 guests