~Servo() { Dispose(); }
could you explain this peace of code?
  | ||||||||||||||
The Netduino forums have been replaced by new forums at community.wildernesslabs.co.
This site has been preserved for archival purposes only
and the ability to make new accounts or posts has been turned off.
hampee's ContentThere have been 8 items by hampee (Search limited from 27-September 23) #22370 Netduino servo classPosted by hampee on 02 January 2012 - 11:14 PM in Netduino 2 (and Netduino 1)
could you explain this peace of code? #23627 Read rc receiver and control escPosted by hampee on 01 February 2012 - 12:51 PM in Netduino Plus 2 (and Netduino Plus 1)
I have done some experimenting but i am not satisfied with they whey i am interacting with my rx reader class.
As for now i have an infinite loop thats constantly is checking the read. I am trying to make this eventbased so i can have an eventhandler calling a method with the new value if read has been changed but i cant get it to work. Is it even posible to do it this way? i have tried doing it like this public delegate void readChanged(int read); public event readChanged read_changed; private InterruptPort pin; private long ticks; public int min, max; public int read { get { return read; } private set { read = value; read_changed(value); } } public rxReader(Cpu.Pin inputPin) { pin = new InterruptPort(inputPin, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth); pin.OnInterrupt += inputHandle_OnInterrupt; } void inputHandle_OnInterrupt(uint data1, uint state, DateTime time) { if (state == 0) read = (int)(time.Ticks - ticks) / 10; else ticks = time.Ticks; } #24643 Read rc receiver and control escPosted by hampee on 24 February 2012 - 03:58 PM in Netduino Plus 2 (and Netduino Plus 1)
Can someone send me in the right direction on how to modify the native oninterrupt event so that it also return the puls length
#22461 Read rc receiver and control escPosted by hampee on 05 January 2012 - 11:33 AM in Netduino Plus 2 (and Netduino Plus 1)
Like this? I'm sorry if my questions is stupid but i just dont want to start of by damaging my board. #22393 Read rc receiver and control escPosted by hampee on 03 January 2012 - 01:13 PM in Netduino Plus 2 (and Netduino Plus 1)
Thanks for your help! I already got a servo class. But its verry diferent from your code. public class Servo { private PWM pin; private uint[] range = new uint[2]; private const uint maxDegree = 180, minDegree = 0; public Servo(Cpu.Pin servoPin) { pin = new PWM(servoPin); pin.SetDutyCycle(0); range[0] = 1000; range[1] = 2000; } public void move(double degree) { if (degree > maxDegree) degree = maxDegree; if (degree < minDegree) degree = minDegree; pin.SetPulse(20000, (uint)map((long)degree, minDegree, maxDegree, range[0], range[1])); } public void setRange(uint fullLeft, uint fullRight) { range[1] = fullLeft; range[0] = fullRight; } private long map(long x, long in_min, long in_max, long out_min, long out_max) { return (degree - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; } } I wrote it but it is highly influenced from some code on this forum so i dont take all credit. unfortunately i havent had a chance to test it yet. But before i do so i thought i sould check with someone more experienced so i dont burn my board. #22443 Read rc receiver and control escPosted by hampee on 04 January 2012 - 04:26 PM in Netduino Plus 2 (and Netduino Plus 1)
I found a thread where you had released a great projekt with a ppm decoder class. I have modified it for my projekt and i am just about to test it. But i would like if someone could confirm i wired right. Now its wired pin d7 to reciver signal pin d5 to servo signal 5v and the gnd next to 5v is connected to the reciver and the +/- from the servo is also connected to reciver. like this #22072 Read rc receiver and control escPosted by hampee on 25 December 2011 - 01:39 PM in Netduino Plus 2 (and Netduino Plus 1)
I just got my netduino but i need some help to get started. I am somewhat experienced in c# but i dont got a clue on the electronic, so i need some help to get started.
My final goal is to make a autonomous boat using gps and a magnometer.But I thought i sould start smaller and just try to make my netduino read a rc reciver and send commands to an esc.
I have found some code on this forum but nothing that explains how to wire the reciver and ecs.
#22237 Is this the end of netduino/arduino boardsPosted by hampee on 30 December 2011 - 01:57 PM in General Discussion
http://www.techspot....oming-soon.html
will cheap computers like this one affect the demand on netduino and arduino boards?
| ||||||||||||||
|
||||||||||||||
This webpage is licensed under a Creative Commons Attribution-ShareAlike License. | ||||||||||||||