Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronic Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Register Log in

How can I write program for more servo

Status
Not open for further replies.

lonely boy

Newbie level 6
Joined
May 18, 2012
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
IRAN
Activity points
1,358
How can I write program for more servo motor

Hi
I want to write program with Bascom or codvision for 20 servos but I have lots of if that its harmful
servo: SG5010 or s03t
microcontroller:avr
compiler:bascom or codvison
I wrote this program with ovf0(over flow 0)
but it's not good for more motors
I wrote program like this:

Code:
$regfile = "m8def.dat"
$crystal = 8000000
Config Portd = Output
Config Timer0 = Timer , Prescale = 1
Dim R As Byte , G As Byte , B As Byte
Dim Pm As Byte
'----------------------------------------
Enable Interrupts
Enable Ovf0
On Ovf0 Makepwm
Stop Timer0
Start Timer0
R = 200 : B = 100 : G = 50
'-------------------------------------
Do

Loop
End

'-----------------------------------
Makepwm:
If Pm = 255 Then Pm = 0
  If Pm = R Then Set Portd.7
  If Pm < R Then Reset Portd.7

  If Pm = G Then Set Portd.6
  If Pm < G Then Reset Portd.6

  If Pm = B Then Set Portd.5
  If Pm < B Then Reset Portd.5
 Incr Pm
Return
 
Last edited:

lonely boy

Newbie level 6
Joined
May 18, 2012
Messages
14
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Location
IRAN
Activity points
1,358
Re: How can I write program for more servo motor

nobody help me!!!!!:shock:
 

Status
Not open for further replies.
Toggle Sidebar

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top