|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: pwms
what i still don't understand is, does pwm<integer goes here> == pin<$1>?
that was really weird short hand for pwm01 == pin01? it would be nice if there was some sort of chart that displayed all of that, not just for pwm outputs of the rc but of the camera, etc. |
|
#2
|
|||
|
|||
|
Re: pwms
Quote:
|
|
#3
|
||||
|
||||
|
Re: pwms
I think what your are asking is how to turn on a motor. Just setting the variable pwm01 will turn on (or off) the motor connected to the first pwm output. The reason all you need to do is set it is because that variable is returned to the master controller and it "writes" it to the register that turns on the motor.
In the default code its just set to the value from the joystick: pwm01 = p1_y; Note: to turn a motor off, set it to 127. Values less than 127 are reverse, values greater than 127 are forward. Its range is 0-255. You can see all the variable you get for input and that you can set for output in the header file ifi_aliases.h Brian |
|
#4
|
||||
|
||||
|
Re: pwms
For programming in linux you can also use picloader to flash the controller. It's available from sourceforge: http://sourceforge.net/projects/ifi-picloader. There's no gui with this, but you can use a text mode view with it if you use picloader_textmode.
|
|
#5
|
|||
|
|||
|
Re: pwms
Assigning a value to a PWM output is not the same as turning a digital output on or off. PWM<x> is a data variable in the block of data which is passed back to the master microprocessor. The master microprocessor handles the radio link and generating the motor signals (there is a way to directly control some of the motor signals, but lets not worry about that at this point). PWM stands for Pulse Width Modulated. The signal on the pwm pin is a stream of pulses at a frequency of about 50-55Hz. The width of the pulse varies between 750 us and 2250 us. A 127 value to the pwm variable generates a pulse width of 1500 us and the motor response to this no movement. A 0 value is full speed in one direction and 255 is full speed in the opposite direction.
|
|
#6
|
|||
|
|||
|
Re: pwms
i think what i am confused about the most is how does all the wiring work?
i think code wise i am fine, but when it comes time to test the code, i'm going to have a lot of problems. where do i connect what to make interrupts work beyond the software abstraction? thanks for all the responses thus far. they are much appreciated. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Good-looking PWMs: is it possible? | Chriszuma | Electrical | 2 | 10-02-2006 00:25 |
| PWMs Active in Programming Mode? | ldeffenb | Control System | 4 | 14-01-2006 07:35 |
| pwms for relays | reilly | Motors | 3 | 18-02-2005 15:02 |
| pwms 13 and 15 in autonomous mode | Chris Bright | Programming | 1 | 24-02-2004 22:25 |
| Mapping Buttons to PWMs | actorindp | Programming | 9 | 10-02-2004 11:11 |