Netduino home hardware projects downloads community

Jump to content


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.

bill.french's Content

There have been 260 items by bill.french (Search limited from 17-June 23)


By content type

See this member's


Sort by                Order  

#4688 Analog Input help...

Posted by bill.french on 08 November 2010 - 11:39 PM in General Discussion

I don't think it works that way, but I really don't know. Why do you have the analog input tied to the adj pin?



#4685 Analog Input help...

Posted by bill.french on 08 November 2010 - 11:19 PM in General Discussion

Oz: Are you sure that diagram is right? It doesn't quite make sense to me. Maybe talk me through it? Why isn't aref tied to the 3.3v line?



#4680 Question regarding listeningSocket.Accept();

Posted by bill.french on 08 November 2010 - 10:25 PM in Netduino Plus 2 (and Netduino Plus 1)

Regarding Fred's webserver -- and other things of this sort that use
listeningSocket.Accept();

How do you kill them if you want them to stop listening? They are in their own threads, waiting for connections. How to you tell it to stop accepting connections, and also make the thread to go away?

My question is actually more about how to do this in general, and not specific to the web server, but it is an example of what I'm trying to understand. Thanks!



#4679 Analog Input help...

Posted by bill.french on 08 November 2010 - 10:14 PM in General Discussion

The analog input pins basically work by returning a value between 0-1023 based on the voltage that is on the pin, relative to aref. Aref is the "analog reference" and sets the "ceiling". Typically you'd tie aref to 3.3v - which is it's maximum. Then, if you put 3.3v on the analog pin, you would get a reading of 1023. If you tied the analog input to ground, you'd get a reading of 0v. if you put 1.6v on the analog input, you'd get a reading around 512, or half the range. The analog inputs can handle a max of 3.3v.

Here's a link to some sample code:
analog sample code

In that code, there's a line:
AP0.SetRange(0, 1023);

This is the default, so it effectively doesn't do anything at all; but, if you do:

AP0.SetRange(0, 3300);

...your readings will match roughly with the actual voltage in millivolts. So, if you put 1.6v on the input, you'll get a reading around 1600 instead of 512.

Hopefully this makes sense?



#4674 Disable Pull-up resistors

Posted by bill.french on 08 November 2010 - 09:46 PM in General Discussion

Have you tried using a pull down resistor? Quickly looking at all the example circuits on the datasheet for the LM35, it looks to me like they have some kind of path to ground. Also, according to the neduino processor datasheet, only AD0-3 have pull up resistors, A4-7 do not?



#4652 Graphing Data from Netduino over the network

Posted by bill.french on 08 November 2010 - 02:58 PM in Netduino Plus 2 (and Netduino Plus 1)

Hello! Both the computer and the ND+ are plugged into switchports on my FiOS actiontel router. The netduino is also plugged in and powered via usb. It mostly works, but when it fails, it's almost always under these scenarios, after opening my forms application: 1. Pressing "play" in VS, which reboots and deploys 2. Unplugging the ND+ and plugging it in My forms app receives the 100, and then the netduino throws exceptions for each of the subsequent transmissions (which I catch and send to output), after the timeout for each one. I know my forms app is still responding, as I can telnet into it and send data while the ND is waiting to time out. But, sometimes it works in #1 and #2. And, it always works when I hit the reset button.



#4637 Graphing Data from Netduino over the network

Posted by bill.french on 08 November 2010 - 05:03 AM in Netduino Plus 2 (and Netduino Plus 1)

I've got my netduino plus talking to a windows forms application over the network, so that this code:
        public static void Main()
        {
            NetLog log1 = new NetLog();

            log1.Host = "192.168.1.12";
            log1.Port = 8000;

            log1.Print("100");
            Thread.Sleep(500);
            log1.Print("400");
            Thread.Sleep(500);
            log1.Print("200");
            Thread.Sleep(500);
            log1.Print("500");
            Thread.Sleep(500);
            log1.Print("300");
        }
...using the Microsoft Charting stuff, produces this graph:
Posted Image

Which makes me happy!

What is weird though is that sometimes, and only from initial boot or by pressing play is VS, the netduino never makes it past sending the first "100" and throws an exception for each of the subsequent sends:

#### Exception System.Net.Sockets.SocketException - CLR_E_FAIL (1) ####
    #### Message: 
    #### Microsoft.SPOT.Net.SocketNative::connect [IP: 0000] ####
    #### System.Net.Sockets.Socket::Connect [IP: 001d] ####
    #### NetLogger.NetLog::Print [IP: 0042] ####
    #### NDP_SocketSender1.Program::Main [IP: 002d] ####
    #### SocketException ErrorCode = 10053
    #### SocketException ErrorCode = 10053
A first chance exception of type 'System.Net.Sockets.SocketException' occurred in Microsoft.SPOT.Net.dll
    #### SocketException ErrorCode = 10053
    #### SocketException ErrorCode = 10053

When the netduino is unable to connect to the forms app, I am able still able to connect to my forms application using telnet, so I know it's still responding. I am on the latest posted firmware.

I'm sure my code is a train wreck, so any advice would be very much appreciated. I don't doubt I'm doing something fundamentally wrong. My next step is to have the act of sending the data spun off into it's own thread. Here are my solution files:


I've been working up the nerve to take a stab at this for a while, eventually to start graphing data from the analog inputs. I was motivated to action after seeing Corey's 2d motion tracker w/ excel graphs using data cut/pasted from the debugger output... I was hoping I'd end up with something slightly useful for his Avatar motion project!

Thanks! --Bill



#4608 Disable Pull-up resistors

Posted by bill.french on 07 November 2010 - 07:53 PM in General Discussion

LOL i was going to link to the previous thread about the LM35 in case there were some hints ... but it's your other thread...



#4607 Disable Pull-up resistors

Posted by bill.french on 07 November 2010 - 07:49 PM in General Discussion

The LM35 seems to have given folks some trouble... I don't have one so I don't know how to fix it. Marius: what if you used a fairly high ohm pull-down resistor? It almost seems like very small output current of the LM35 has nowhere to go. Instead of the cpu acting like it has a pull up resistor, it simply has too high of a resistance to sink the current away. This is all wild guessing on my part.



#4590 External buttons problem

Posted by bill.french on 07 November 2010 - 05:43 PM in General Discussion

can you post your complete source code?



#4580 MFToolkit - new release (VS2010 support / .NET MF 4.1)

Posted by bill.french on 07 November 2010 - 02:08 PM in Netduino Plus 2 (and Netduino Plus 1)

Very awesome, thank you!



#4565 2D Motion Capture, early results

Posted by bill.french on 07 November 2010 - 05:37 AM in Project Showcase

Glad you enjoyed my very advanced Paint.Net skills!

Thinking about it (the project) some more, the datasheet says 5us is "typical"... (and since you say you got the pwm call wrong anyway) which makes me wonder if you could have gotten away with something like:

out1.Write(true);
out1.Write(false);

which, according to here, gets you a 60us pulse.

... I also wonder if you had gpio pins to spare, you could you one pin in output mode to fire the pulse, then another pin in input mode (both tied to the sig pin on the ping thing) to read the returning pulse, then you wouldn't have to worry about .Dispose()'s timing.



#4562 2D Motion Capture, early results

Posted by bill.french on 07 November 2010 - 04:52 AM in Project Showcase

While I was admiring your project, and your strategic use of .Dispose(), I couldn't help but think the displayed frame from your youtube video looked like you were trying to punch Beaker, but missed.

Posted Image



#4547 MFToolkit - new release (VS2010 support / .NET MF 4.1)

Posted by bill.french on 07 November 2010 - 12:02 AM in Netduino Plus 2 (and Netduino Plus 1)

Is there a link to just what exactly the above MFToolkit is? I was not able to find a site that stated a simple overview of what it is and why it exists. Thanks!



#4449 Deadmau5 mask

Posted by bill.french on 03 November 2010 - 09:10 PM in Project Showcase

So.... How did the costume work out??



#4393 Where to find these connectors?

Posted by bill.french on 31 October 2010 - 11:36 AM in General Discussion

This is probably not exactly what you're looking for, but maybe? They are Ampmodu connectors, you'll commonly see them as the internal audio connection for a cdrom drive:

Posted Image

-- but they come in lots of different sizes, are keyed, and available from mouser:

mouser catalog page

One disadvantage, possibly, compared to what you posted is the jacks are usually 90 degree to the pcb. Here's an arduino shield with a bunch of the connectors as an example:

Posted Image



#4381 HXT 900 Servo

Posted by bill.french on 31 October 2010 - 12:29 AM in Netduino 2 (and Netduino 1)

www.hobbycity.com has lots and lots of servos at very low prices.



#4362 .Net, Fred's webserver, and me

Posted by bill.french on 30 October 2010 - 12:39 AM in Netduino Plus 2 (and Netduino Plus 1)

Awesome, thank you, sir. Maybe in a couple weeks I can buy you a roast beef, mutz, and gravy sandwich when i'm in hoboken next.



#4361 Netduino at PDC 2010 (or watch online)...

Posted by bill.french on 30 October 2010 - 12:37 AM in General Discussion

Thanks, Raven, for the link. I love this stuff!



#4356 Netduino at PDC 2010 (or watch online)...

Posted by bill.french on 29 October 2010 - 11:04 PM in General Discussion

managed to miss the whole thing... ugh, anyone have a link yet??



#4334 How to utilize full range of Analog Input

Posted by bill.french on 29 October 2010 - 12:04 AM in General Discussion

I'd be curious to know how to do this, too. My thoughts: 1. I believe you can use the aref to reduce the ceiling, so if you gave aref 2.2v instead of 3.3v, you could get 0-1023 mapped to 0-2200mV, which is a little better. 2. I don't believe you can raise the floor on the built in ADC... i think you'd need to use a differential adc for that? Or, what about this: (i have no idea if this would work at all) 1. Run j1 through a diode -- i wonder if the .7v drop across the diode would get your output from 1.6-2.2 to .9-1.5v? 2. Feed 1.5v to aref then, your 0-1023 would map to 900mV to 1500mV? IF that works, maybe two diodes? I suspect there's not enough current moving for the diodes to work. This is all wild guessing on my part.



#4331 .Net, Fred's webserver, and me

Posted by bill.french on 28 October 2010 - 11:09 PM in Netduino Plus 2 (and Netduino Plus 1)

This has been great for me.

Corey, if I can get a little more time from you, or anyone else:

But you may be wondering why the link you posted has such complicated code. The answer is that Bill Gates is much smarter and richer than you and me, and therefore he has thought very hard about the difference between finalization and disposing. The rules are subtle and complicated (by the way, the link you posted also has it a little bit wrong)


Is the issue in:
        ~DisposeObject()

        {

            Dispose(false);

        }

? It seems this finalizer doesn't do anything, and based on what you said:
1. It should call CleanUp()
2. CleanUp() should deal with only unmanaged stuff
3. managed stuff should be handled in the if(disposing) block

Thanks, all, again. --Bill



#4315 .Net, Fred's webserver, and me

Posted by bill.french on 28 October 2010 - 12:20 PM in Netduino Plus 2 (and Netduino Plus 1)

Damn, I hate posting code online.

Please please please don't stop!! Certainly not because of anything I've said! You're a hero in my book.

Wow, thanks everyone, I have read every word and I think I get it. My original post was primarily about tricking smart people into teaching me something I probably should have already known, for free. However, a part of me hopes I'm not alone and that it might be useful for someone else.

I also think this discussion really reveals how awesomely powerful the netmf is -- i can't imagine the competing platforms are having these types of discussions. I am certainly capable of understanding these things, but the subtleties of the implementation are tough, or at least, unobvious. (A tilde means what??)

I have been thinking about the using statement (and IDisposable, but not as much - and only tied the two together in the last 24 hours) for at least 5 years. I've read what it does, but have never gotten to the "but, why?" part. This line in the .net wiki sums up my frustration:

You should be familiar with the pattern or with the interface because it's a basic thing to know about the .Net framework.


Basic thing to know?? Why? I've read many books and created .Net applications that (admittedly small numbers of) people are actively using on a daily basis and never touched/actively avoided it.

I learn much better when there's a practical application involved, and the nd+ web server seemed like a perfect opportunity for me to bring myself forward with code I otherwise understand.

Concerning the multithreading, I agree that how it is done is probably the most appropriate. Threading is also something I'm trying to wrap my head around, so I'm happy to see i've gotten myself to the point of identifying it... how to make it multithreaded (or if it even should be) i will leave up to you all, but maybe I'll tackle it.

So, am I getting this right:
The point/advantage of having Listener implement IDisposable is so others can now call it in a using() (since using() requires the IDisposable interface) and trust it to clean up after itself. Does the IDisposable stuff also get called if, at some point in Program.cs, webServer = "null"? I think "yes".

Thank you, all, again.



#4302 .Net, Fred's webserver, and me

Posted by bill.french on 28 October 2010 - 03:29 AM in Netduino Plus 2 (and Netduino Plus 1)

ourt post timing seems to be crossing... lol i appreciate your regions link, too. Concerning GC.SupressFinalize -- in your opinion would it be appropriate in the webserver? Why or why not?



#4301 .Net, Fred's webserver, and me

Posted by bill.french on 28 October 2010 - 03:25 AM in Netduino Plus 2 (and Netduino Plus 1)

Phantom, besides having some hilarious comments, your linked articles seem to argue against working so hard to explicitly dispose of objects c++ style, just when I was starting to get into it w/ c#. What I linked above seemed to argue for IDisposable in the context of exceptions and future-proofing, which I can get behind.

Most of what I've written in the past only dealt with exceptions as a bad thing that end a program, I do know that I need to explore using exceptions in positive ways, somewhat similar to events.




home    hardware    projects    downloads    community    where to buy    contact Copyright © 2016 Wilderness Labs Inc.  |  Legal   |   CC BY-SA
This webpage is licensed under a Creative Commons Attribution-ShareAlike License.