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

A Hardware guy drowning in a Software world!


  • Please log in to reply
15 replies to this topic

#1 Bill E.

Bill E.

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationSilicon Valley, California

Posted 25 August 2011 - 12:52 AM

I apologize ahead of time for the long post. As a newbie to the C# world I, as a hardware weenie, try day after day to bring some semblance of personal sanity to the C# experts posts, books, examples, etc. Inevitably I give up suffering from cranial pain!! I see all the posting folks having hardware questions and issues and want to yell out "it's so simple!!" then I look at the C# examples and say to myself "what the heck are they saying??!!!" I have some Fez hardware (Panda and Domino), which I think is pretty awesome but can't really talk to it effectively, and Netduino Mini, which I think is a wonderful, fantastic piece of BS2 replacement hardware! Alas, I can't effectively talk to it either. I had to slug through the pin definitions of which GPIO pin is assigned to the actual hardware (of the Mini) and got that figured out. Miracle!!! Now I want to get to the meat of the hardware and get to timers, interrupts, external embedded devices and I keep getting C# red underlines - Ahhhhh!!! Public, Private, Static, focus, modules, scope, ... I understand that stuff from C and BASIC (sorry guys!). Now OOP is kiling me! I have book after book of Visual Studio 2010, C#, .NET, .NET Micro, etc. and they are ALL oriented towards software people. The "Beginners Guide" stuff from GHI is good but, hello!, it's for software people! There is essentially no, ZERO, guides available for the Secretlabs Netduino and Fez hardware. If it is online I have it. Giga bytes. I design embedded "periherals" in my sleep. I love PIC programming and hardware design. But this C# stuff escapes me! Help!! I have a slick Parallax Basic Stamp Super Carrier board outfitted with a Netduino Mini and a BOE Bot chassie et.al. and am able to get it roving around a room. but I need to read wheel speed, collision avoidance (from my embedded sensor design, if anyone is inerested), etc. with interrupts and timers - which prompted this post. So now I am throwing myself at the mercy of the C# gurus and screaming for help. If anyone needs hardware help, let me know!

#2 Terry Massey

Terry Massey

    Advanced Member

  • Members
  • PipPipPip
  • 77 posts
  • LocationPekin, IL

Posted 25 August 2011 - 03:09 AM

Can you explain to me a little more detail. when you say read wheel spin as in rotery encoder data?
Thanks,
Terry Massey

#3 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 25 August 2011 - 05:19 AM

Dear Bill, welcome in this forum. You may even get a headache by reading it, but we are a bunch of friends talking together, as we were in a great cafè! So, enjoy...

I am an EE, but since the beginning I loved the "programmibility" of some circuits. Programming in assembler is much like reading the data-sheet of a certain CPU, then applying the rules given by the manufacturer. In other words, YOU must think as the machine does.

Programming in C/C++ is much like my kid often says: "I wish have to sort my room, but I have no time (and I want to play instead)". From my eyes of "physician" (there are well defined rules), programming in C/C++ is a big mess, where anyone can do anything. A sort of anarchy world. No surprise when the leaks pops out, or some pointer is pointing "somewhere else"!

As the hardware resources became cheaper, the programming language has evolved toward much more well defined. The actual problem, if you want, is that every manufacturer would to promote its own language, instead to create an unified one (accepted worldwide). Here I don't want to process this or that language, and just talk about C# because it is primarily involved in the Net Micro Framework, thus Netduino and GHI's stuffs.
C# is a C++ looking language, having several well-defined rules. That leads to several benefits in order to create an application:
  • strongly-typed language, so there's no way to misintepret a data type;
  • well-structured language model;
  • garbage-collection, so you won't have to worry about the deletion of any object no more useful;
  • the compiler is able to detect many mistakes;
  • induction to the "pattern-practice" programming (instead to write bunch of code "spaghetti-glued");
and many others.
All these benefits have a cost in terms of:
  • loss of performance;
  • high request of resources (RAM, ROM and CPU)
Since I am NOT a CS, I am not the right person to describe the features. I just want to show my viewpoint as a "hardware-born" guy.

Let's get back...
When you want to get a led blinking, perhaps the C#, thus the Micro Framework, are a bit overkill. The advantage is becoming clear when you are going to create medium-complex apps. On PC, I have programmed for years in Pascal, VB6 and others, but .Net (and C#) decreased dramatically the errors in my apps, as long the reliability is much higher.

If you read my signature, I may describe the .Net+C# as "a decent attempt to rule the software world, so that it will be a bit less messy".
The road is still very long, however.
Cheers
Biggest fault of Netduino? It runs by electricity.

#4 stan4th

stan4th

    Member

  • Members
  • PipPip
  • 27 posts

Posted 25 August 2011 - 06:23 PM

Hi Bill, it sounds as thought you would benefit from a tutorial book on programming in C# but which also teaches rather than assumes knowledge of programming concepts. I'm not the best person to suggest such a book as I'm a CS, so maybe others on the board might have some good suggestions. Maybe there are already a few threads on this board. Good luck

#5 Glen

Glen

    Member

  • Members
  • PipPip
  • 26 posts

Posted 25 August 2011 - 09:19 PM

Did you check out the "Getting Started with the internet of things" book? It's tailored specifically for the netduino and starts from the basics for the programming portion. Like many others though, I'm a .net developer without much hardware experience, so my perspective is a bit different. There was a discount for it that is mentioned in this thread: http://forums.netdui...k-oreilly-make/ I bought it at the start of this month and the deal was still good then.

#6 Bill E.

Bill E.

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationSilicon Valley, California

Posted 26 August 2011 - 01:25 AM

What a great response so far. Thank you all. Glen, I ordered the book/downloaded/and started reading. Thanks for the link (I didn't know the ebook was ready yet!) and coupon. $12. Awesome. Coupon is still good ... Mario, I appreciate the warm welcome. I will keep your advice in mind. Stan4th, likewise - thanks for the support. Now Terry, I want to have interrupts in my code that will allow me to determine the time between interrupts of a simple photo reflective photodetector from both of the wheels (left & right). That way I can maintain a straight path and calculate turn angles. If you are familiar with the Parallax continuous rotating servos and the wheels they provide, there are 8 oval slots that can let the reflector "not refect" when the sensor is over a gap. That is my interrupt. Measure the time from the last gap to the current gap (for both left & right) and I have a reference. There is the need for my Timer questions. I am using (obsolete but replaceable with new RoHS parts) Fairchile QRB1134 sensors mounted close to the wheels to detect the gaps. There will be a gap every 45 degrees. The collision detector is a home made PIC based 38KHZ IR remote controller and an Osram IR LED. I pulse that at ~38KHZ and watch for reflections and the PIC processes all of that stuff for me. If anyone wants the schematic & HEX code for the detector just let me know. It works beautifully (and the parts are very inexpensive). I can provide jpg's if anyone wants. I am an EE. My degree is, believe it or not, in Computer Science!! But, that was in 1986. Soooo much has changed since then. I am the poster child of the "use it or lose it" syndrome. No-one wants to know about the low, sewer level details of the FAT system anymore. Or the gory details of a mere flip-flop ... Shall I continue? Great forum. Great posts. And, again, if anyone needs hardware help, I will keep my eyes open & try to help you.

Attached Files



#7 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 26 August 2011 - 04:44 AM

No-one wants to know about the low, sewer level details of the FAT system anymore. Or the gory details of a mere flip-flop ... Shall I continue?

I agree at 100%.
Almost any EE knows how to programming, surely not the best way, but he knows both the disciplines.
A CS does not learn anything about electronic, and does not want to learn it.
Any reason?
Cheers
Biggest fault of Netduino? It runs by electricity.

#8 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 26 August 2011 - 01:19 PM

I apologize ahead of time for the long post.

As a newbie to the C# world I, as a hardware weenie, try day after day...

...

So now I am throwing myself at the mercy of the C# gurus and screaming for help.


This is a great post and I want to comment on so many things that have been said… starting at the top.

I’m sure it’s hard on both sides of the fence... because I am on that other side from you. It’s very hard to gauge what and how much help someone needs. Most of us are quite secure in our careers and we’re not used to having to ask for help. So sometimes it’s hard for us to ask or ask such that it gets an answer that actually helps us. When a hardware person says “it’s so simple” tends to make me think I’m asking stupid questions when I ask for hardware help. But I’m struggling with what I’m sure are simple concepts to you… like pull-up and pull-down resistors, how to use a voltage regulator BUT MAINLY should I be using a voltage regulator in “this” situation.

Someone that didn’t come from a formalized CS background might understand your needs best. Mario stands out in my mind since he also comes from a hardware background. I actually come from an AE background, but made the transition to professional programmer in the early ‘90s. I still remember the epiphany when OOP finally made sense over the rigid, procedural methods my ’60 era PhD professors taught in structural engineering classes in the ‘80s. It’s not that it’s that difficult, it was more a matter of losing pre-conceived notions.

The biggest struggle (I would imagine) for you will be coming to grips with the .NET framework. C# in itself is logical… used procedurally or with OOP concepts. But knowing what class to use and which methods or properties are needed must seem to you like me trying to decide between two model numbers of some voltage regulator OR if even the voltage regulator is what I need at all! It’s all FM to me! The second thing that will cause confusion will be the multithreaded aspects that other microprocessors like Arduino don’t have (so I hear).

Good question… to you hardware types… Are there any other Microprocessors that inherently have multithreading?

To start answering you specific questions… I offer this. If you are more of the dig-it-out-on-your-own type of guy, I think the class you are looking for is: InterruptPort. If you want a little more how to use… I’ve been exploring this same issue in this article: Spin'r Up.... In it you will find the source code that should be close to what you will need in a very software equivalent of a bread-board style. In the follow up article (hopefully out this weekend) I will be encapsulating it in a more professional class of its own.

If it doesn’t help you as it stands, it would be very helpful back to me IF YOU do ask more questions. It would help me greatly to understand the struggles of my peer’s on this forum.

If anyone needs hardware help, let me know!


AND… if you could offer the other side of the fence on this question of mine: Proper Servo Driving...
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#9 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 26 August 2011 - 01:32 PM

If you read my signature, I may describe the .Net+C# as "a decent attempt to rule the software world, so that it will be a bit less messy".
The road is still very long, however.
Cheers


Hi Mario,

Have you been reading any of the news on the upcoming Windows 8? The reason I ask... your statement above... maybe be a little dated.

For all those with any history with Microsoft, you know that they change directions at the drop of the hat... Pascal, VB, C, C++, C#, jQuery or COM, DCOM, COM++, Webservices...

Anyway, there were some comments in the intro video of Microsoft’s upcoming Windows 8 (by Microsoft) that they may be abandoning C# and .NET entirely and moving to html and javascript as the main programming paradigm for the new OS. It has the blog-o-sphere in an uproar!
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#10 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 26 August 2011 - 01:44 PM

...
I am using (obsolete but replaceable with new RoHS parts) Fairchile QRB1134 sensors mounted close to the wheels to detect the gaps. There will be a gap every 45 degrees.
The collision detector is a home made PIC based 38KHZ IR remote controller and an Osram IR LED. I pulse that at ~38KHZ and watch for reflections and the PIC processes all of that stuff for me. If anyone wants the schematic & HEX code for the detector just let me know. It works beautifully (and the parts are very inexpensive). I can provide jpg's if anyone wants.
...


My eyes are about to roll back into my head with all the EE words. :blink: If I didn't read your specific software need in the first post, I would be totally lost by this statement… and I’m quite comfortable with the physics needs behind your project!

AND OH HAIL... YES! <in my best southern drawl> Bring on the pictures.
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#11 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 26 August 2011 - 01:57 PM

A CS does not learn anything about electronic, and does not want to learn it.
Any reason?


Not being a CS guy, I can only speculate from the cheap seats.

  • As you EE types will attest… The CS guy’s world turns upside down every so often… yours (to its merits) doesn’t. CS people just don’t have the time.
  • Maybe its friendly (or not so friendly) rivalry. I know in my ex world of AE, we had some of our own… Although Aerospace Engineers, Mechanical Engineers and Civil Engineers share much of the formal training there was the saying...
“AE’s design weapons, ME’s carry our weapons to the launch pads and CE’s make targets.”

My sister and brother-in-law are both EE types and I can attest to a definite pecking order in their world as well!
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#12 Nevyn

Nevyn

    Advanced Member

  • Members
  • PipPipPip
  • 1072 posts
  • LocationNorth Yorkshire, UK

Posted 26 August 2011 - 02:27 PM

A CS does not learn anything about electronic, and does not want to learn it.

Too general a statement says the software engineer :)

regards,
Mark

To be or not to be = 0xFF

 

Blogging about Netduino, .NET, STM8S and STM32 and generally waffling on about life

Follow @nevynuk on Twitter


#13 Glen

Glen

    Member

  • Members
  • PipPip
  • 26 posts

Posted 26 August 2011 - 03:06 PM

Hi Mario,

Have you been reading any of the news on the upcoming Windows 8? The reason I ask... your statement above... maybe be a little dated.

For all those with any history with Microsoft, you know that they change directions at the drop of the hat... Pascal, VB, C, C++, C#, jQuery or COM, DCOM, COM++, Webservices...

Anyway, there were some comments in the intro video of Microsoft’s upcoming Windows 8 (by Microsoft) that they may be abandoning C# and .NET entirely and moving to html and javascript as the main programming paradigm for the new OS. It has the blog-o-sphere in an uproar!

Please don't spread FUD. Microsoft isn't abandoning C# at all. Even if they completely cut silverlight(which they haven't claimed to be doing), that doesn't mean they are getting rid of C#. All this sprang from some windows 8 demo using html5 and javascript and people started freaking out about silverlight(maybe?) being killed and that somehow cascaded down to C#.

Microsoft hasn't made any statements of cutting silverlight or C# or .net.

Anyway, there were some comments in the intro video of Microsoft’s upcoming Windows 8 (by Microsoft) that they may be abandoning C# and .NET entirely

Source? The video I *think* you may be referring to that started this mess, made no such claims of C# being cut out. That was some conclusions people somehow jumped to and some media and microsoft competitors ran with.

#14 Mario Vernari

Mario Vernari

    Advanced Member

  • Members
  • PipPipPip
  • 1768 posts
  • LocationVenezia, Italia

Posted 26 August 2011 - 07:38 PM

Have you been reading any of the news on the upcoming Windows 8? The reason I ask... your statement above... maybe be a little dated.

For all those with any history with Microsoft, you know that they change directions at the drop of the hat... Pascal, VB, C, C++, C#, jQuery or COM, DCOM, COM++, Webservices...

Anyway, there were some comments in the intro video of Microsoft’s upcoming Windows 8 (by Microsoft) that they may be abandoning C# and .NET entirely and moving to html and javascript as the main programming paradigm for the new OS. It has the blog-o-sphere in an uproar!

Personal viewpoint. MS is going to create new solutions and/or renew existing ones for several reasons (I don't want to process what they are). My job is design software in collaboration with my team, which is creating hardware and firmware instead. All these things must agree, and be realiable.
Most of the MS promises (or perspectives) are *FAR* from being applied in our world. So, WinXP or Win8, there are many tech areas that are marginally involved in this change.
Some example:
  • the hardware is often fitting the specific target requested: no excessive overhead of resource are allowed, due excessive costs;
  • the firmware is far from being C#-like, because (1) it's not real-time, and (2) would require ton of hw resources;
  • most of our customers DO NOT want to connect their system to the internet, due the possibility of intrusion or whatever else;
  • most of our customers DO WANT still to use XP, because they (1) don't like to change OS, and (2) too bad voices over Vista (with Win7 is getting better, but many water has to flow under the bridge...)
  • ...and so away...
Of course there are many other system that may take advantage of the new platform, but I won't be scared about the managed languages. Cutting out C# would be as Mr Gates was shoot at his feet.
Personally, I don't like so much the web over the desktop. A web page has many wonderful benefits, but it's far from being compared to the simplicity and the performance of a good desktop app. Maybe the web will surpass the desktop, but I guess that takes many years to be a reality.
Cheers
Biggest fault of Netduino? It runs by electricity.

#15 Inquisitor

Inquisitor

    Advanced Member

  • Members
  • PipPipPip
  • 91 posts
  • LocationAtlanta, Georgia, USA

Posted 27 August 2011 - 08:44 PM

I am very sorry to have caused such a tangent in this thread. My comment on the Win 8, html, JavaScript… was meant to be in the vein of…

… You may even get a headache by reading it, but we are a bunch of friends talking together, as we were in a great cafè! So, enjoy...


I just meant it to be a casual comment over a beer… NOT a world changing moment. Glen you are correct, after reviewing the video again… it does not say abandoning C#.NET, but does say a “new platform”. So my words were inflammatory, however, it’s only FUD if someone is scared of change. It didn’t even cross my mind that it might cause anyone even a moment’s pause. And anyone who has programmed for any length of time knows change is inevitable. If I was still (as I once was) doing (1) Fortran on Unix… (2) C with Windows SDK or (3) C++ with MFC, I would be far less marketable (and less productive) than I am now with C#.NET! Some day (and I don’t think any time soon) something will replace C# and .NET. It’s nothing to fear… it’s just a simple fact.

Windows 8 “is said” to be a significant change and at least partially a response to iOS and Android. The fact that Microsoft has lost considerable momentum (if not market share) as compared to Apple and Google surely is not lost on Microsoft. Opening up the development arena on Windows 8 to the html /java script world makes a lot of sense. Will Microsoft abandon C#.NET? Not likely, but Microsoft hasn’t really abandoned C/SDK developers, Web Forms, Windows XP, DCOM or any number of other, “old” technologies.
Doing my best to keep the smoke in the little black boxes.
If my message helped you... how 'bout giving me a Posted Image
www.MessingWithReality.com

#16 Bill E.

Bill E.

    Member

  • Members
  • PipPip
  • 26 posts
  • LocationSilicon Valley, California

Posted 27 August 2011 - 10:15 PM

I wanted to do one last reply on this post. This has indeed been a great post and I really appreciate the replies. I am attaching my design files and the hex file need to build my proximity (or collisioin) sensor. Good luck and don't hesitate to ask for help if you need it! Regards.

Attached Files






0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users

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.