DaveKR - Viewing Profile: Posts - Netduino Forums
   
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.

DaveKR

Member Since 11 Apr 2012
Offline Last Active Jan 11 2015 10:30 AM
-----

Posts I've Made

In Topic: how do you read analog signal to digital

27 April 2013 - 03:21 PM

Hi, I just would like to mention that there is another method of reading anolog Inputs if you are using 4.2 and ND2 (+?). You can just set some Properties of the class of type AnologInput and you´re (almost) done with math. (See the ReadScaled method in code) Here´s an example of both methods (ReadingRaw and ReadingScaled):

static AnalogInput voltagePort = new AnalogInput(AnalogChannels.ANALOG_PIN_A0); // Use for Netduino Plus 2//AnalogInput voltagePort = new AnalogInput(Pins.GPIO_PIN_A1);  // For Standard Netduino       public static void Main()        {            while (true)            {                Debug.Print(ReadScaled().ToString("f") + "," + ReadRaw().ToString("f"));                Thread.Sleep(300);            }        }        public static double ReadScaled()        {            const double maxVoltage = 3.3;                          voltagePort.Scale = maxVoltage;            voltagePort.Offset = 0.0;            double voltagevalue = voltagePort.Read();            //double realworldvalue = (((voltagevalue - 0.5) * 1000) / 10) - 4;            return voltagevalue;        }        public static double ReadRaw()        {            const double maxVoltage = 3.3;            const int maxAdcValue = 4095; //12bit AD converter in ND2+            double rawValue = voltagePort.ReadRaw();            double voltagevalue = (rawValue * maxVoltage) / maxAdcValue;            //double realworldvalue = (((voltagevalue - 0.5) * 1000) / 10) - 4;            return voltagevalue;        }

In Topic: Reproducable firmware crash (and driver crash with bluescreen)

14 December 2012 - 03:22 PM

Hi Chris,

first of all let me say thank you for your effort in pushing .NET MF for µC´s ! I really enjoy working with netduino and C#. I believe this combination has a lot of potential. It will bring "software" software developers and "hardware" software developer closer together, and both parties will benefit. It´s really cool to use technologies like OOP,MVC,ASPX,... to control some piece of hardware.

Hi David,

I do wish that we could just turn off Intellisense for the Cpu.Pin enumeration sometimes. It would make things simpler :)

Well, that is really a problem here.I always teach students to RTFM, and somehow intelliSense is a manual too. :huh:


This is actually how NETMF was designed to work. In brief:
1. Cpu.Pin refers to the physical pin #s on the microcontroller itself. By connecting to CPU pins 11-13, you're taking over the USB pins of the microcontroller.
2. The Pins.GPIO_### enumeration refers to the pin headers on the Netduino Plus 2. These are mapped internally to the microcontroller pins.

Thank you for clarification, that is exactly what I guessed. That is the problem of enumerations, they are all just integer values and therefore we are not type-safe here :-(


Hopefully we can turn any potential confusion into something which can be a good teaching point: explaining how the connections on the blue headers are physically attached to the microcontroller pins, and how students are interacting directly with the microcontroller.

Yes, but I would like to avoid negative experiences from the beginning on. If only two of my students brick their netduinos that easy they will be demotivated. (And probably the other 20 will try this right away ;-) )


Sorry for any confusion. It may be possible for us to throw an exception for Ports trying to use reserved pins, to protect against this; I'll put that on my list of potential enhancements that we can add in NETMF.

That sounds good ! :-)I have the Feeling that it´s not enough to block some pims but also some critical combinations of pins


Welcome to the Netduino community,

Chris


In Topic: Netduino Plus + ID-20 (again!)

02 July 2012 - 07:34 PM

Hi Jace,

did you find a solution ? I have exactly the same behaviour here :-(

David


Hi all,

I'm a software developer by nature and have recently started a little Research project. I might warn you, i am an absolute beginner when it comes to electronics, but through a few days of reading I believe I grasp the basic concepts of what I want to do - however, bear with me all the same! :)

So all I want to do, is hook up and ID-20 to a netduino plus and read a couple RFID button tags and capture their RFID in a C# application. But for the life of me I can't do it! And yes, I have read everything to do with the ID-12/20 and the netduino on these forums and the web.

I've tried the code here: http://forums.netdui...ch__1#entry7082

and code here: http://www.hackmeist...egory/netduino/

I do not receive any input. Sometimes it seems as though I receive input and I hit my breakpoints in my code and I receive some arbitrary number of bytes (EDIT: between 1-13), but after calling mySerialPort.Read(...) my buffer still reads 0 for every index in the byte[].

I've wired my netduino plus as follows:

  • ID-20 pin 1 to netduino grnd
  • ID-20 pin 2 to netduino 5v
  • ID-20 pin 7 to netduino grnd
  • id-20 pin 9 to netduino D0
  • ID-20 pin 11 to netduino 5v

I'm using these RFID buttons: http://littlebirdele...fid-button-16mm

I'm not wiring the reset port or an LED - does this matter?

I have not installed the firmware from here: http://forums.netdui...mware-v420-rc1/
Does this matter? I'm currently running version 4.1.0.6

If you need more information, please let me know and I will happily hunt it down. I could have just made a silly mistake! Thanks in advanced, and thank you for building an extensive community here at netduino.com :D

Jace


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.