Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2016-03-16 20:44:47

ier123
Member
Registered: 2016-03-16
Posts: 5

PWM pin mode

I am trying to use the PWM pin mode to control a basic motor. As documented in the Raspberry Pi Rex User Guide, it says that GoTo RPI__PWM18 will produce output on pin 18. I am getting no output from pin 18 when I implement this block. However, if I rename the block to RPI__GPIO18, I get output on pin 18. A picture of the block I've set up is attached. Any suggestions on setting up PWM would be helpful. Thanks in advance.

Offline

#2 2016-03-17 09:04:12

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: PWM pin mode

Please, can you attach whole Rex project (.mdl files)? It would be much easier to find the issue in your implementation.

Regards, Tomas

Offline

#3 2016-03-25 18:31:55

ier123
Member
Registered: 2016-03-16
Posts: 5

Re: PWM pin mode

Attached are two .mdl files: motor_task.mdl and motorTest.mdl
On the Pi (without REX) we use the RPIO library and the PWM commands to control the output and change the frequency and/or duty cycle, but have run into some issues trying to copy this type of functionality via REX.  Is there a demo file for a working PWM setup with a Raspberry Pi?  Do you have any guides for the proper setup for a Pi?

Offline

#4 2016-03-25 23:57:50

josar
Member
From: Czech Rep.
Registered: 2015-11-03
Posts: 17

Re: PWM pin mode

The PWM range is 0..1023. Multiply your boolean signal by 1023 to get full duty cycle (use GAIN block).

Offline

Board footer

Powered by FluxBB