Hi, everyone!This is my first time i am going to use a PWM to control a servo. I wanted to start from my Fez Raptot, but i don’t have a power module yet to power up the board, so i decided to try it on FEZ Cerbuino bee.
Help me to clarify the following questions please:
which socket should i use on cerbuino bee?
i am going to use a breakout tb10 module. Wich pin of the module should i use for connection with a servo signal wire?
i am using a net gadgeteer project. Can you show me a code sample how to control a servo in my scenario (cerbuino bee->socket number->tb10 module->pin number-> gadgeteer project code sample)?
You can use the individual pins in a socket in one of two ways - quick and dirty, or “like a tiger” I mean “like a driver”. If you do it like a driver does, you basically create a constructor that then allocates the pins you need within the Gadgeteer framework - if you find a driver that uses PWMOutputFactory class you’ll find an example how to do it “correctly”. I personally can’t think of a module using the P socket, can anyone? Anyway, you could use one of those to look at specifics how to implement that if you so choose, but I’ll show you the quick and dirty, grab a pin and go, way.
@ Brett -
I won this fighting, thank you for the information you provided! It really helped me to achive the result. You was right about the Cpu.PWMChannel it didn’t work for me at all, instead i used a Cpu.Pin directly and i am done.