- Netduino Forums
- → Thomas Rankin's Content
Thomas Rankin's Content
There have been 12 items by Thomas Rankin (Search limited from 03-May 23)
#50451 N+2 to 3.3v I2C
Posted by Thomas Rankin on 13 June 2013 - 12:06 AM in Netduino Plus 2 (and Netduino Plus 1)
#43534 Introducing Netduino Plus 2
Posted by Thomas Rankin on 16 January 2013 - 03:13 PM in Netduino Plus 2 (and Netduino Plus 1)
Totally agree, being able to simply plug in a battery and get an RTC would be fantastic.
#42969 [FIXED IN FW 4.2.2] Simple Question about Servo
Posted by Thomas Rankin on 08 January 2013 - 02:42 PM in Netduino Plus 2 (and Netduino Plus 1)
Ahh Steve thanks.. I haven't done much server or PWM work before so it was pretty easy to doubt my understanding. I ran through several tests and verified that changing the period does not have any effect on the position with a given duration, so I feel better that it's not related to some magic number ratio.
Thomas
#42950 [FIXED IN FW 4.2.2] Simple Question about Servo
Posted by Thomas Rankin on 08 January 2013 - 03:50 AM in Netduino Plus 2 (and Netduino Plus 1)
Admittedly I'm still wrapping my head around what the hardware does with a period of 20000 and a duration of 2500. My tests show that I needed to double my durations when my period is set @ 20000. The documentation that you read indicating position should not be nebulous, with your statement of 1ms or 2ms. Typically there is a very specific pulse for a very specific position.
I've yet to figure out why I have to double my pulses to get the levels that I expect.
My understanding is that a period of 20000 means 20ms from pulse to pulse... and 1.5 ms duration means how long. The question really for me is whether it is supposed to be a ratio of the period, or an amount of time.
I pulled NETMF 4.2 driver code from the forum, but I pulled my hair a bit until I realized that I got exactly the results that I expected when I doubled my durations from the tech spec, but the example code all showed similar boundaries to what I was expecting.
So.. either my servo (HS-322HD Deluxe) is very different from others in the example or the example code has never been tested on the N+2.
Tech spec shows pulse widths of 600 to 2400 for 180 degree motion with a 20ms pulse cycle.
No answers really just more questions.
#42503 DS1821 temperature sensor over OneWire on Netduino Plus 2
Posted by Thomas Rankin on 31 December 2012 - 03:01 PM in Netduino Plus 2 (and Netduino Plus 1)
Hi Thomas - Thanks for posting this. I have the DS18B20 One Wire temperature Sensor (https://www.sparkfun.../products/11050) and was wondering if this would work the same for what I have? I am a .NET Developer who is a complete newbie to electornics. Is there a chance you could post how you wired up your temperature sensor to the Netduino Plus if it is not too much trouble. I have the NP 1 but would assume there is not much of a difference?
Thanks!
Don
Don, I just realized that you indicated that you've got an NP1, and while that would not effect wiring much if at all, the NP1 does not have built in OneWire support. You have a couple of options as I can see.
1: Build a custom firmware with OneWire support (there are posts on the forum about it)
2: Use a hardware OneWire translater or build one yourself with an attiny or pic
3: Upgrade to the NP2
Thomas
#42460 electric imp
Posted by Thomas Rankin on 30 December 2012 - 08:36 PM in General Discussion
I've got one, but haven't played with it much. Having too much fun with my Netduino right now to figure out their IDE and programming. I like the fact that it's inherently got wireless communication out of the box...
#42222 DS1821 temperature sensor over OneWire on Netduino Plus 2
Posted by Thomas Rankin on 26 December 2012 - 06:35 PM in Netduino Plus 2 (and Netduino Plus 1)
Hi Thomas - Thanks for posting this. I have the DS18B20 One Wire temperature Sensor (https://www.sparkfun.../products/11050) and was wondering if this would work the same for what I have? I am a .NET Developer who is a complete newbie to electornics. Is there a chance you could post how you wired up your temperature sensor to the Netduino Plus if it is not too much trouble. I have the NP 1 but would assume there is not much of a difference?
Thanks!
Don
I'm not sure if the protocol is the same for the DS18B20, but I know that I had trouble finding DS1821 solutions because it is non-addressable. I think there are many example solutions for the DS18B20. http://www.tinyclr.c...earch?q=DS18B20 http://forums.netdui...-using-onewire/ also has some descriptions for wiring.
Best of luck.
#42013 Netduino Plus 2 OneWire
Posted by Thomas Rankin on 21 December 2012 - 08:59 PM in Beta Firmware and Drivers
Hi,
How can i have OneWire function in Firmware 4.2.0 ? I guess it is successor of Firmware 4.1.0 so it must have this in it,doesn't it?
ThankYou
I have successfully used OneWire in Firmware 4.2.1.2. So I can confirm that it is in that firmware.
There are a few examples on the forum for onewire executions.. like http://forums.netdui...re-temp-sensor/
http://forums.netdui...etduino-plus-2/
#41987 how to end a NativeEventHandler Thread
Posted by Thomas Rankin on 21 December 2012 - 02:04 AM in Netduino Plus 2 (and Netduino Plus 1)
http://www.netduino.com/projects/
I think it is a working example of your objective. I apologize for not answering why your code doesn't work.
I'm having a problem with ending a NativeEventHandler(button). The problem is main thread stuck at the join() function. I dont understand why the childthread is not released after it is run.
public class Program { private static Thread mainThread; private static Thread childThread; private static InterruptPort button = new InterruptPort(Pins.GPIO_PIN_D1, true, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLevelHigh); private static OutputPort led = new OutputPort(Pins.ONBOARD_LED, false); public static void Main() { mainThread = Thread.CurrentThread; Thread.Sleep(1000); while (true) { Thread.Sleep(100); button.OnInterrupt += new NativeEventHandler(ButtonEvent); mainThread.Suspend(); childThread.Join();//It stuck here. Thread.Sleep(100); button.EnableInterrupt(); button.ClearInterrupt(); } } private static void ButtonEvent(uint port, uint state, DateTime time) { childThread = Thread.CurrentThread; button.DisableInterrupt(); mainThread.Resume(); // Thread.CurrentThread.Abort(); this .Abort() seems doesn't terminate the thread either. } }
#41857 DS1821 temperature sensor over OneWire on Netduino Plus 2
Posted by Thomas Rankin on 19 December 2012 - 02:35 AM in Netduino Plus 2 (and Netduino Plus 1)
public class Program { static OutputPort owPort = new OutputPort(Pins.GPIO_PIN_D0, false); static OneWire DS1821 = new OneWire(owPort); public static void Main() { lcdDisplay.Clear(); while (true) { string tmp = GetTemperature().ToString("F2"); lcdDisplay.SetCursorPosition(0, 0); lcdDisplay.Write(tmp); Thread.Sleep(100); } } public static float GetTemperature() { ushort temp_read = 0; ushort count_remain = 0; ushort count_per_c = 0; ushort configuration_register = 0; ushort whileCount = 0; // One -Shot Convert Temp DS1821.TouchReset(); DS1821.WriteByte(0xEE); // Loop and sleep a bit until it is done converting the Temperature data. do { Thread.Sleep(10); configuration_register = 0; DS1821.TouchReset(); DS1821.WriteByte(0xAC); // Read the configuration Register from the DS1821 configuration_register = ReadBytes(1); whileCount++; } while (((configuration_register & (1 << 7)) == 0) && whileCount < 100); // If Bit #8 is 1 then we are finished converting the temp if (whileCount >= 100) return -1; // Get Temp DS1821.TouchReset(); DS1821.WriteByte(0xAA); temp_read = ReadBytes(1); ; // Get Count Remaining DS1821.TouchReset(); DS1821.WriteByte(0xA0); count_remain = ReadBytes(2); // Load The Counter to populate the slope accumulator DS1821.TouchReset(); DS1821.WriteByte(0x41); // Read Count Per Deg DS1821.TouchReset(); DS1821.WriteByte(0xA0); count_per_c = ReadBytes(2); // If we are reading above the 200 mark then we are below 0 and need to compensate the calculation if (temp_read >= 200) temp_read -= 256; var highResTemp = (float)temp_read - .5 + (((float)count_per_c - (float)count_remain) / (float)count_per_c); return (float)((1.80 * highResTemp) + 32.00); } static ushort ReadBytes(ushort count) { ushort val = 0; for (ushort i = 0; i < count; i++) { val |= (ushort)(DS1821.ReadByte() << i * 8); } return val; } }
#38764 Introducing Netduino Plus 2
Posted by Thomas Rankin on 08 November 2012 - 05:10 PM in Netduino Plus 2 (and Netduino Plus 1)
#30656 Help with Digital Output
Posted by Thomas Rankin on 14 June 2012 - 03:06 AM in General Discussion
- Netduino Forums
- → Thomas Rankin's Content
- Privacy Policy