SC08A and command

Autonomous Robot, Manual Robot, DC Motor Driver, Stepper Motor Driver, Servo, Multi PWM chip.....

SC08A and command

Postby sahniana » Thu Jun 12, 2014 5:43 pm

i dont really understand on how to write the sc08a command in mikrobasic language. please guide.
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm

Re: SC08A and command

Postby sahniana » Sat Jun 14, 2014 12:41 pm

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?
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm

Re: SC08A and command

Postby sahniana » Sat Jun 14, 2014 5:51 pm

ive connect to PC using uc00b, testing using sc08a gui. got error, "rc_report.fail1". what does it means?
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm

Re: SC08A and command

Postby yonghui » Sun Jun 15, 2014 4:30 pm

Have try look at citron tutorial?
http://tutorial.cytron.com.my/2011/08/1 ... project-2/

Sent from my T100TA using Tapatalk
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: SC08A and command

Postby sahniana » Sun Jun 15, 2014 5:23 pm

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.
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm

Re: SC08A and command

Postby yonghui » Mon Jun 16, 2014 10:02 am

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?
thanks&regards,
yh
yonghui
Moderator
 
Posts: 732
Joined: Mon Sep 28, 2009 3:27 pm

Re: SC08A and command

Postby gadgetng » Mon Jun 16, 2014 4:01 pm

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
Discoverer
 
Posts: 97
Joined: Tue Jul 24, 2012 11:20 am

Re: SC08A and command

Postby sahniana » Mon Jun 16, 2014 8:37 pm

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?
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm

Re: SC08A and command

Postby gadgetng » Tue Jun 17, 2014 8:17 am

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:
gadgetng
Discoverer
 
Posts: 97
Joined: Tue Jul 24, 2012 11:20 am

Re: SC08A and command

Postby sahniana » Tue Jun 17, 2014 5:46 pm

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..
sahniana
Apprentice
 
Posts: 44
Joined: Wed Jul 01, 2009 4:30 pm


Return to Robot Controller

Who is online

Users browsing this forum: No registered users and 16 guests