Page 1 of 1

SC08A and command

PostPosted: Thu Jun 12, 2014 5:43 pm
by sahniana
i dont really understand on how to write the sc08a command in mikrobasic language. please guide.

Re: SC08A and command

PostPosted: Sat Jun 14, 2014 12:41 pm
by sahniana
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?

Re: SC08A and command

PostPosted: Sat Jun 14, 2014 5:51 pm
by sahniana
ive connect to PC using uc00b, testing using sc08a gui. got error, "rc_report.fail1". what does it means?

Re: SC08A and command

PostPosted: Sun Jun 15, 2014 4:30 pm
by yonghui
Have try look at citron tutorial?
http://tutorial.cytron.com.my/2011/08/1 ... project-2/

Sent from my T100TA using Tapatalk

Re: SC08A and command

PostPosted: Sun Jun 15, 2014 5:23 pm
by sahniana
yonghui WROTE:Have try look at citron tutorial?
http://tutorial.cytron.com.my/2011/08/1 ... project-2/

Sent from my T100TA using Tapatalk


yes. still got error. fault board? but i push the test button, the servo run.

Re: SC08A and command

PostPosted: Mon Jun 16, 2014 10:02 am
by yonghui
i think the error u mentioned come from the GUI software. maybe the visual studion version incompatible? mayb u can try to recompile the GUI. or mayb u can send packet through terminal software like XCTU to test?

Re: SC08A and command

PostPosted: Mon Jun 16, 2014 4:01 pm
by gadgetng
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.

Re: SC08A and command

PostPosted: Mon Jun 16, 2014 8:37 pm
by sahniana
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.


i just modified the code from cytron arduino tutorial to mikrobasic language style. n currently, the windows app provided by cytron cant control the board too. is this mean that my sc08a is not functioning well?

Re: SC08A and command

PostPosted: Tue Jun 17, 2014 8:17 am
by gadgetng
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. :lol:

Re: SC08A and command

PostPosted: Tue Jun 17, 2014 5:46 pm
by sahniana
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. :lol:


u got a point there.i think i will try to communicate with pc first, need to build new application for it..