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

Basic Tutorials


  • Please log in to reply
13 replies to this topic

#1 my401k

my401k

    New Member

  • Members
  • Pip
  • 5 posts

Posted 04 November 2010 - 11:05 PM

Really could use a few basic tutorials here. Maybe I'm missing something but I've spent the last few hours googling and searching the forums here trying to find very basic info on reading and writing to the I/O pins on the netduino.

Empty.. zilch. The quickstart guide to turning on and off and onboard LED certainly doesn't provide any usable information to interfacing with the Netduino... Is the Quickstart Guide "it" as far as docs go??? I can't find anything else and the arduino stuff seems to be completely unrelated.

Maybe I'm an idiot but I got an mbed up and running a servo motor (using pulse and direction to amp) and reading an 8000ppr differential encoder at 2000rpm in an afternoon.

While I'm ranting... the light gray text on a white background in these forums is horrendous.... :blink:

Any help would be greatly appreciated

#2 Frank

Frank

    Advanced Member

  • Members
  • PipPipPip
  • 62 posts
  • LocationNorth Waterboro Maine

Posted 05 November 2010 - 12:11 AM

I found that just typing in the blinking light example, I found out a great deal when Visual Studio offered all the choices for each structure. It's not quite fill in the blanks but pretty close ! Since they're brand new, only released a couple months ago, and shooting for the holiday season, these guys have been answering more questions than I ever thought they would. The Forums are short enough that a quick read through some of the threads brings out a lot of information. Welcome. And I agree, the light gray on white, is hard on the eyes.
Retired -stone sculptor -macro photographer- novice but avid Go player - Geek

#3 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 November 2010 - 01:06 AM

Hi my401k, First of all, welcome to the Netduino community. To read and write to the digital pins, you'll use InputPort and OutputPort exactly like in the "blinky led/pushbutton" examples. But instead of Pins.ONBOARD_LED, use Pins.GPIO_###. As an example using blinky, you can plug an LED into pin D13 and GND--and then just change the pin in code to Pins.GPIO_D13...and you'll have a blinky LED. We're working on a more thorough "Getting Started" book, and O'Reilly's "Getting Started with the Internet of Things" (using Netduino Plus) should be available soon as well. There's a ton of work going on behind the scenes to bring you more samples, more instructions and tutorials, and more capabilities. Thank you for your involvement, enthusiasm, and patience. Chris

#4 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 05 November 2010 - 01:20 AM

I might have some time this weekend to post a long tutorial showing digital output and input. When I do that I will post it on the forums. Chris W. while we are on the topic of tutorials, maybe a tutorial thread would be a nice addition to the forums?

#5 MattW

MattW

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 November 2010 - 12:32 PM

I wouldn't say the arduino stuff seems to be completely unrelated. I've learnt a lot from reading the arduino tutorials and code and using similar circut layouts and converting the code to C#, even though I've never touched one. There's some great tutorials (from Sparkfun and Earthshine Electronics, for example) that takes you though many projects. Using their tutorials, I was able to figure out how to get shift registers working, blinking lights, button inputs, etc. Now I'm taking myself though the "Make - Electronics" book to get some more solid grounding before I start building serious stuff...

#6 my401k

my401k

    New Member

  • Members
  • Pip
  • 5 posts

Posted 05 November 2010 - 01:36 PM

Thanks for all the responses and the welcome. I guess I meant to say that the code side of the arduino and netduino don't really correlate. I can get outputs to turn on and off but I'm still unable to read an input. I can declare the input without a problem (it builds and runs anyway) but I can't figure out how to correctly reference the input state. I can put 3.3v or ground into the input but it doesn't seem to change state. Are Netduino digital inputs active high or low? (what voltage do they need to be pulled to for logic 1) My short term goal is to feed an output into an input to see how fast the I/O are (with and without an interrupt)

#7 my401k

my401k

    New Member

  • Members
  • Pip
  • 5 posts

Posted 05 November 2010 - 01:39 PM

Welcome. And I agree, the light gray on white, is hard on the eyes.


My young eyes would have been fine -my old eyes can barely read it :unsure:

#8 MattW

MattW

    Member

  • Members
  • PipPip
  • 23 posts

Posted 05 November 2010 - 01:50 PM

Ahh - gotcha. You can get the basic logic from anduino code, but you are right - it can be quiet different. :)

#9 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 05 November 2010 - 04:34 PM

I can get outputs to turn on and off but I'm still unable to read an input.
I can declare the input without a problem (it builds and runs anyway) but I can't
figure out how to correctly reference the input state. I can put 3.3v or ground
into the input but it doesn't seem to change state.

Are Netduino digital inputs active high or low? (what voltage do they
need to be pulled to for logic 1)


To read inputs, 3.3V-5V is "true" and 0V is "false." Use InputPort.Read() to get the current state. Something like...

// to declare your input port
InputPort inputPort = new InputPort(Pins.###, ...) // choose your pin, turn on/off glitch filter, etc.

// to read the value
state = inputPort.Read();

Chris

#10 my401k

my401k

    New Member

  • Members
  • Pip
  • 5 posts

Posted 05 November 2010 - 11:43 PM

To read inputs, 3.3V-5V is "true" and 0V is "false." Use InputPort.Read() to get the current state. Something like...

// to declare your input port
InputPort inputPort = new InputPort(Pins.###, ...) // choose your pin, turn on/off glitch filter, etc.

// to read the value
state = inputPort.Read();

Chris


Thanks..

Could swear I tried that.... but I'll try again

#11 my401k

my401k

    New Member

  • Members
  • Pip
  • 5 posts

Posted 06 November 2010 - 12:04 AM

Thanks..

Could swear I tried that.... but I'll try again


Hi Chris,

Thanks for taking the time to post an answer.

I did try that... VS kept giving me a syntax error.. something about "variable being used as a method" or vise versa... anyway... ignored it, built, ran... no more errors.. runs as expected.. wtf? :angry:

so much for intellisense (at least in this instance)

thanks again

#12 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 06 November 2010 - 04:01 AM

Hi Chris,

Thanks for taking the time to post an answer.

I did try that... VS kept giving me a syntax error.. something about "variable being used as a method" or vise versa... anyway... ignored it, built, ran... no more errors.. runs as expected.. wtf? :angry:

so much for intellisense (at least in this instance)

thanks again


awwww I'm too late huh? I just finished making a video.... oh well. glad to know you got it to work! goo luck with your project

#13 Chris Walker

Chris Walker

    Secret Labs Staff

  • Moderators
  • 7767 posts
  • LocationNew York, NY

Posted 06 November 2010 - 05:23 AM

awwww I'm too late huh? I just finished making a video.... oh well. glad to know you got it to work! goo luck with your project


oz, we'd still love to see your video. :)

Chris

#14 Omar (OZ)

Omar (OZ)

    Advanced Member

  • Members
  • PipPipPip
  • 564 posts

Posted 06 November 2010 - 05:49 AM

oz, we'd still love to see your video. :)

Chris

... its so late! Luckily I got it done just now. I'll post it on a new thread.




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.