|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
GeneratePWMS
I'm trying to read in a PWM. How do I do this?
On the edubot, they have the "setup who control pwms" function that changes the pwm_mask variable in the tx_data struct, but what does this do for me? This variable exists in the FRC code, so I can change it there, but I don't understand how this gets me input since there is no place for pwm inputs in the rx_data structure. |
|
#2
|
|||
|
|||
|
Re: GeneratePWMS
Why do you want to use a pwm as an input?
|
|
#3
|
|||
|
|||
|
Re: GeneratePWMS
some sensors allow I2C input or PWM input, and we don't have access to the I2C
|
|
#4
|
|||
|
|||
|
Re: GeneratePWMS
I believe that there are a few #define statements in one of the header file that change PWMs 13-16 to either IFI_PWM or USER_CCP. That might be what you're looking for...
|
|
#5
|
|||||
|
|||||
|
Re: GeneratePWMS
Quote:
|
|
#6
|
|||
|
|||
|
Re: GeneratePWMS
Quote:
|
|
#7
|
|||
|
|||
|
Re: GeneratePWMS
Thanks guys. I found a way to do it. Took some experimenting, but here it is:
Run the sensor output into digital inputs 2 and 3. Have interupt on 2 for the rising edge and one for the falling edge. The first starts the timer, the second reads it out and scales it. I haven't actually tried this - I'll probably fool with it post-build season, but I was just thinking ahead since my team doesn't let me touch the bot. Something about building it.... Last edited by Neal Turett : 23-02-2004 at 23:28. Reason: lots of typos |
|
#8
|
|||
|
|||
|
Re: GeneratePWMS
Quote:
|
|
#9
|
||||
|
||||
|
Re: GeneratePWMS
Quote:
-Kevin |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|