Getting Started with Netduino 2
#1
Posted 09 March 2013 - 04:23 AM
#2
Posted 09 March 2013 - 10:46 AM
SecretLabs.NETMF.Hardware.AnalogInput analogInput = new SecretLabs.NETMF.Hardware.AnalogInput(Pins.GPIO_PIN_A0);We'll be updating the book samples online soon so that you don't need to do the modifications yourself. Does that get you up and running? Chris
#3
Posted 13 March 2013 - 12:56 AM
Thanks very much Chris. I will try them out and will update this post
#4
Posted 13 March 2013 - 11:02 AM
Thanks very much, I finally made it working by following your advise:
[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]"If you're using AnalogInput, add the SecretLabs.NETMF.Hardware.AnalogInput.dll assembly as a reference to your project. If you're using PWM, add the SecretLabs.NETMF.Hardware.PWM.dll assembly as a reference to your project."[/color]
#5
Posted 07 April 2013 - 08:56 AM
Hello Chris (or other expert).
First time netduino user here. I have very little programming experience and none in C (installed Visual C# 2010 express yesterday - never used before).
I know more about hardware than software so I'm just doing basic coding and I too follow the example in your book. Could you provide me with the code for "[color=rgb(40,40,40);font-family:helvetica, arial, sans-serif;]If you're using PWM, add the SecretLabs.NETMF.Hardware.PWM.dll assembly as a reference to your project.[/color]" (as I'm using i/o 5 wich from what I understand is the PWM port). Also, on which line should I paste this .dll reference to make it work (under the "using SecretLabs.NETMF.Hardware.Netduino;" ? )
Thanks in advance!
Netduino Plus 2 (v4.2.2.2)
#6
Posted 07 April 2013 - 07:08 PM
Ok I found the code:
SecretLabs.NETMF.Hardware.PWM pwm = new SecretLabs.NETMF.Hardware.PWM(Pins.GPIO_PIN_D5);
I will experiment with this tomorrow.
Netduino Plus 2 (v4.2.2.2)
#7
Posted 07 April 2013 - 07:36 PM
I know more about hardware than software so I'm just doing basic coding and I too follow the example in your book.
Neat, another hardware geek!
We are taking over!
You may want to check out my example, and project that you can download, that I listed at:
http://forums.netdui...etduino-plus-2/
I write in the more familiar "C" "K&N"-style.
For one thing, I have a better feeling on how it compiles. For a Framework, like the .NET Framework, it gets harder to determine, because it gets compiled into intermediate code.
Note: Using "C" and the style does not mean that the code gets compiled to assembler for the Netduino (or under C#). It still gets compiled into Common Intermediate Language (CIL) code.
I haven't bothered to determine what really happens in assembler instructions, with code that is done like below:
if (i < 10) { tmp = new int; tmp = 0; if (j++ < 100) { tmp = j + i; k = tmp + tmp; }}
With the "tmp = new int" statement, are any additional assembler instructions executed when it comes into or goes out of scope? Or, does the compiler allocate space on the stack at the start of the procedure, and just flag any incorrect references to "tmp" as errors?
There are also many more cases.
FWIW, I used YACC in Grad school to get a C-compiler for our/my Z8000 system that I was using. I taught C and assembler to undergrads. And, I've done (too much ) optimization of assembler code over the years.
#8
Posted 07 April 2013 - 08:20 PM
Helllo Cutlass.
Thank you for the link to your post. Now I know how to add the refference and how to read analog input data!
It all makes sense now :-)
Netduino Plus 2 (v4.2.2.2)
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users