How do you control a servo with a microcontroller in Flowcode 5
I was just going to use a pwm macro but according to my teacher I need to bring the speed down to a period of 20ms which can't be done. Now it wouldn't be the first time he's wrong.
So there is a PWM component macro in flowcode 5 and a servo component macro, yet he still says none work.
Does anyone know for sure if it works and if it doesn't, how can I do it?
What OddBot said is the
What OddBot said is the truth.
And some servos can’t use the full 1ms-2ms range. In other words, the range for these servos might be 1.1ms - 1.9ms. However, I’ve never seen a standard hobby RC servo that doesn’t have it’s center position very close to 1.5ms, but I’m not a servo expert and there are a lot of different RC servos.
What microcontroller board are you using? Can you put a URL to it?
Likewise with Flowcode 5. I’ve never heard of that language before.
The basic algorithm is that every 20ms you send out pulses (usually between 1ms to 2ms) to each servo you are controlling.
You can do this with system clocks and interrupt routines or whatever your language and board supply.
Please let us know how it goes.
flowcode is a program that
flowcode is a program that uses graphical input for C,
this is not my current program
as for the board, I use a circuit board I designed with the PIC16F1828.
the problem with the basic function in the program is that you can only devide your frequency by 16 which is not enough.
I might be able to fix this by inserting a C code block, but I don't know how to change it in C
The following forum post looks like it should help you.
http://www.matrixtsl.com/mmforums/viewtopic.php?f=7&t=11919
Like Duane said, searching for Flowcode 5 servo (control) brings up any number of hits. The information must be there. The crew here is more than willing to help if/when they can, but, flowcode is a fairly new beast around here. Most of the guys and gals here actually write code and more often than not use arduino/avr. Duane is a Propeller guy. bdk6 was very happy with ARM based chips. PICs don’t get a lot of representation here no matter what language they are programmed in.