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.

knut.tveitane

Member Since 21 Jan 2014
Offline Last Active Oct 06 2015 11:40 AM
-----

Posts I've Made

In Topic: netduino IDE's

10 July 2014 - 07:45 AM

Let's keep things separate: C# is a programming language - it is NOT an IDE. The IDE used for programming the NetDuino is the same IDE used for programming .Net solutions for Windows and Web - it is called Visual Studio (VS). Using VS, you have a choice of languages, but for Netduino development the selection is limited to C# and Visual Basic (I think... but I haven't tried to use any other). Both languges are used also for Windows and Web development, and currently not all language features are available in the downscaled .Net Micro Framework which is used for NetDuino development.

 

-knut


In Topic: Enum to string - is there a convenient way in the MF?

08 July 2014 - 06:57 AM

Elizabeth, did you really try this? I think you didn't, because although this is what the documentation says and how it works in .Net, in my experience it does NOT work like this in .NetMF. That is also the reason this question came up in the first place.

 

.ToString() gives you the string representation of the integer value of the enum element: I.e. if you have an enum

    public enum MyEnum { First, Second, Third }, then MyEnum.First.ToString() will return "0". In .Net, it would be "First".

 

Same the other way around, .NetMF does NOT parse strings to enum values like .Net - the Enum.Parse() method is not supported.
 


In Topic: A problem with HttpWebRequest in VS Express for C#

07 June 2014 - 07:12 AM

In the micro framework, these classes are found in the assembly System.Http, so you need to add a reference to that one. The namespace is System.Net.


In Topic: trying to flash an LED and pluse a piezo in error state

21 May 2014 - 07:29 AM

knut.tveitane, thought. Would it be better to use i++ or ++i? I realize what the difference is between the specific lines, but thinking about application.

Used as a statment on its own, the result is the same. The difference in semantics is only significant if used as part of an expression, where you reference the variable: ++i increments the variable before it is referenced, i++ after. (Actually, i = ++i would work in your case - and in this case, the assignment is plain redundant).

 

As a standalone statment, i++ is used more often - but this is only a convention. Following conventions is not a bad habit, though.


In Topic: trying to flash an LED and pluse a piezo in error state

20 May 2014 - 02:27 PM

 

First, this line is redundant:

  1. i = i++;

Note - it is not just redundant, it is not doing what you (probably) want to achieve. The i++ construct increments the variable i *after* it has been referenced, but *before* the assignment is fullfilled. In other words, i will have the same old value after this statement as it had before.


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.