- Netduino Forums
- → bill.french's Content
bill.french's Content
There have been 260 items by bill.french (Search limited from 17-June 23)
#4688 Analog Input help...
Posted by
bill.french
on 08 November 2010 - 11:39 PM
in
General Discussion
#4685 Analog Input help...
Posted by
bill.french
on 08 November 2010 - 11:19 PM
in
General Discussion
#4680 Question regarding listeningSocket.Accept();
Posted by
bill.french
on 08 November 2010 - 10:25 PM
in
Netduino Plus 2 (and Netduino Plus 1)
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
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
#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)
#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)
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:
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
#4607 Disable Pull-up resistors
Posted by
bill.french
on 07 November 2010 - 07:49 PM
in
General Discussion
#4590 External buttons problem
Posted by
bill.french
on 07 November 2010 - 05:43 PM
in
General Discussion
#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)
#4565 2D Motion Capture, early results
Posted by
bill.french
on 07 November 2010 - 05:37 AM
in
Project Showcase
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
![Posted Image](http://www.stopreinventingthewheel.com/srtw/images/goofy/beaker.png)
#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)
#4449 Deadmau5 mask
Posted by
bill.french
on 03 November 2010 - 09:10 PM
in
Project Showcase
#4393 Where to find these connectors?
Posted by
bill.french
on 31 October 2010 - 11:36 AM
in
General Discussion
![Posted Image](http://clickercable.com/catalog/images/11a1-12418.jpg)
-- 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](http://www.bizoner.com/images/bzb878007_01sdf9_03.jpg)
#4381 HXT 900 Servo
Posted by
bill.french
on 31 October 2010 - 12:29 AM
in
Netduino 2 (and Netduino 1)
#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)
#4361 Netduino at PDC 2010 (or watch online)...
Posted by
bill.french
on 30 October 2010 - 12:37 AM
in
General Discussion
#4356 Netduino at PDC 2010 (or watch online)...
Posted by
bill.french
on 29 October 2010 - 11:04 PM
in
General Discussion
#4334 How to utilize full range of Analog Input
Posted by
bill.french
on 29 October 2010 - 12:04 AM
in
General Discussion
#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)
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)
Please please please don't stop!! Certainly not because of anything I've said! You're a hero in my book.Damn, I hate posting code online.
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)
#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)
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.
- Netduino Forums
- → bill.french's Content
- Privacy Policy