![]() |
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. |
Re: GeneratePWMS
Why do you want to use a pwm as an input?
|
Re: GeneratePWMS
some sensors allow I2C input or PWM input, and we don't have access to the I2C
|
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...
|
Re: GeneratePWMS
Quote:
|
Re: GeneratePWMS
Quote:
|
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.... |
Re: GeneratePWMS
Quote:
|
Re: GeneratePWMS
Quote:
-Kevin |
| All times are GMT -5. The time now is 04:18. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi