Thread: pwm 13-15
View Single Post
  #3   Spotlight this post!  
Unread 04-10-2003, 12:08
FotoPlasma FotoPlasma is offline
\: |
no team
 
Join Date: Jul 2001
Rookie Year: 2001
Location: San Jose
Posts: 1,900
FotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond reputeFotoPlasma has a reputation beyond repute
Send a message via AIM to FotoPlasma
If I understand you correctly, you want the drive_L variable to be used for both PWM16 and PWM14, and the drive_R to be used for PWM13 and PWM15.

One way you could do this is to place each of those two variables (drive_L and drive_R) into the positions for each of the two PWM outputs in the SEROUT command.
Code:
'  Serout USERCPU, OUTBAUD, [255,255,(PWM1),relayA,(PWM2),relayB,(PWM3),(PWM4),(PWM5),(PWM6),(PWM7),(PWM8),(PWM9),(PWM10),(PWM11),(PWM12),(PWM13),(PWM14),(PWM15),(PWM16),(OSC)]

   SEROUT USERCPU, OUTBAUD, [255,255,127,relayA,127,relayB,127,127,127,127,127,127,127,127,127,127,drive_R,drive_L,drive_R,drive_L]
The first line is the example SEROUT that IFI provides in the default 2003 EduRC code, so what I did was place the drive_L and drive_R variables in the string of output bytes where the system will be expecting PWM[13-16]. I set all other PWM values to 127, but you can replace these with whatever you'd like.

I hope this helps. If I misunderstood the question, I blame the fact that I just woke up...
__________________
I played hacky sack with Andy Baker.

2001-2004: Team 258, The Sea Dawgs
2005: Team 1693, The Robo Lobos