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 05-July 23)


By content type

See this member's


Sort by                Order  

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

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

This is like c# therapy.. thank you!

I like this explanation on using and IDisposable -- does that sound about right to you?

I've also figured out that the #Region stuff is not a requirement, just a nice way to structure the code, right?

Should you have "GC.SuppressFinalize(this);" as in here? Or is that not applicable in netmf?

Reading the webserver code, I am understanding how it's non-blocking -- but is it multithreaded? There's certainly threads involved, but to make it multithreaded, it seems that once you got a clientsocket, that should be spun off into it's own thread (which would deal with the response) so that the next connection could be accepted? I don't doubt that I'm misunderstanding this. Am I missing something?

Thank you so much for your time!



#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.



#8012 Doing a PIC's Job

Posted by bill.french on 20 January 2011 - 07:00 PM in General Discussion

So, I've been looking over battery charger ICs and I found one that I really like, the trouble is that it's a "thermally-enhanced TSSOP" package which has a pad that needs to get soldered to the circuit board. It also looks very surface-mount and I don't have anything to deal with that. Is there any way to utilize this IC or should I look for something that's easier to use?

other than the thermal pad, you could hand solder this, i think.

Or use this: http://www.proto-adv...ucts_id=2210234

It has videos and everything!



#7211 Doing a PIC's Job

Posted by bill.french on 07 January 2011 - 02:13 PM in General Discussion

Batteries are often rated on their discharge/charge capabilities as multiples of "C". So, for instance, a 2000mah battery might have a discharge rating of 20C and a charge rating of .5C, which means you can discharge it at 40 amps (2000ma * 20) and charge it at 1 amp. Generally higher C batteries are higher quality and more expensive. If you don't mind me asking, what are you doing with this and why no LiPo?



#7243 Doing a PIC's Job

Posted by bill.french on 07 January 2011 - 09:01 PM in General Discussion

ah, sorry, I thought since you could use a 3.3v FTDI cable, you could power it with that. Apparently not!! My mini arrives today, i have 1 hard lesson out of the way!



#6927 Doing a PIC's Job

Posted by bill.french on 03 January 2011 - 08:25 PM in General Discussion

Sorry, that's a typo, I meant 1-10 cells.

LOL, well, that does make a difference. Even with 10 cells, though, they might peak as high as 1.5v/cell (or more depending on what you're dealing with), so that's still 15v.



#6910 Doing a PIC's Job

Posted by bill.french on 03 January 2011 - 01:27 PM in General Discussion

One thing to consider is the 20 cell aspect; 20 x 1.2v = 24v, so you'd have to boost your 12v to *at least* 24 volts, probably significantly more. This charger costs $17 and charges up to 15 MiMH cells: http://www.hobbyking...idProduct=11668 This one does up to 27 cells and costs $37: http://www.hobbyking...idProduct=12104 The $17 one is so cheap you could buy it and scavenge things like the display and voltage booster from it and come out ahead of the game.



#7231 Doing a PIC's Job

Posted by bill.french on 07 January 2011 - 08:22 PM in General Discussion

Thank you for the explanation!

but I wanted to use a netduino mini since I have a fair understanding of C# and I'm pretty sure that doesn't run on 3V

I think you could get away with 3v on the mini, on the 3.3v pin.

Also, this site I think has a lot of "in car" stuff, like this:
http://www.mini-box....8&category=1264

...which you might think about using with a small lead-acid battery. Just throwing stuff out there.

Good luck with this!



#5008 Digital spirit-level, which sensor?

Posted by bill.french on 17 November 2010 - 04:22 PM in General Discussion

Accelerometers generally should detect gravity as acceleration.



#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...



#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?



#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.



#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!



#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!



#5970 Anyone have a clever hex->byte conversion routine?

Posted by bill.french on 10 December 2010 - 01:07 PM in Netduino 2 (and Netduino 1)

Thank you for the explanation, Chuckie. It seems hard enough for me to find stuff normally, and now I'm up against hidden stuff?? :unsure:



#5956 Anyone have a clever hex->byte conversion routine?

Posted by bill.french on 10 December 2010 - 02:02 AM in Netduino 2 (and Netduino 1)

What namespace is that under? I'm thinking the netduino does not support Convert.ToInt32?



#5960 Anyone have a clever hex->byte conversion routine?

Posted by bill.french on 10 December 2010 - 03:01 AM in Netduino 2 (and Netduino 1)

I tried really hard to be clever and this is what I came up with:

        public static byte[] GetByteArray(string s)
        {
            return System.Text.Encoding.UTF8.GetBytes(s);
        }
        public static byte GetByteFromHex(string s)
        {
            return GetByteFromHex(GetByteArray(s));
        }
        public static byte GetByteFromHex(byte[] ba)
        {
            return (byte)((((ba[0] > 96) ? ba[0] - 87 : ba[0] - 48) * 16) + ((ba[1] > 96) ? ba[1] - 87 : ba[1] - 48));
        }



#5796 Anyone have a clever hex->byte conversion routine?

Posted by bill.french on 06 December 2010 - 02:58 AM in Netduino 2 (and Netduino 1)

it doesn't appear that netmf supports int.Parse(hexValue, System.Globalization.NumberStyles.HexNumber); .. so does anyone have a clever hex to byte (or int or whatever) conversion routine handy, so that if I feed it the string "ff" it returns the number 255 in some form? Thanks!!



#5867 Stepper Motor Control?

Posted by bill.french on 07 December 2010 - 06:04 PM in Netduino 2 (and Netduino 1)

I've added a step genie to my Christmas list: http://www.stepgenie.com/



#5875 Stepper Motor Control?

Posted by bill.french on 07 December 2010 - 07:57 PM in Netduino 2 (and Netduino 1)

The demo board is for a parallel port, I would go with the step genie and four of the mosfet things they recommend, assuming you have that type of stepper motor.. I've never driven a stepper so this is all guessing on my part.



#6157 Netduino Plus - First impressions from a beginner

Posted by bill.french on 16 December 2010 - 05:34 PM in Netduino Plus 2 (and Netduino Plus 1)

It's a Microsoft Tag. I was hoping it was some secret stuff, but it was more along the lines of "Drink More Ovaltine".

Microsoft Tags are actually really cool things.



#6164 Netduino Plus - First impressions from a beginner

Posted by bill.french on 16 December 2010 - 08:43 PM in Netduino Plus 2 (and Netduino Plus 1)

Thanks Bill.

Er, what can I do with it?

Jim


Well, if you've got a smartphone, you can get the microsoft tag app, scan it with your phone, and it will send you to the netduino download section.




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.