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

MPR121 Capacitive Touch Breakout

mpr121 breakout capacitive conversion

  • Please log in to reply
1 reply to this topic

#1 justinmchase

justinmchase

    New Member

  • Members
  • Pip
  • 1 posts

Posted 03 September 2014 - 02:10 AM

So I am a total n00b to the netduino and I am trying to prototype something fun. I bought the netduino plus 2 and one of these bad boys:

https://www.sparkfun.com/products/9695

 

I got my machine setup and I'm able to do a simple blinking light demo so I know the netduino is basically working. Now I am trying to convert this arduino C code into a comparable netduino app:

https://github.com/s...Q/C code/main.c

 

I am having a hard time understanding how to convert this into netduino. Could someone help me? I'm not necessarily asking for you to do it all but it would be really nice to get some pointers on how concepts in arduino map to what classes in netdunio. 

 

For example this little function:

int checkInterrupt(void)
{
    if ((PIND & (1<<2)) == 0)
        return 0;
    else
        return 1;
}
 
What is the equivalent to PIND in netduino?

I'm sorry if this is too dumb of a question for these forums, I'm just having a tough time so far. Any help would be greatly appreciated, thanks!


#2 ShVerni

ShVerni

    Advanced Member

  • Members
  • PipPipPip
  • 138 posts
  • LocationNew York, New York

Posted 04 September 2014 - 01:51 AM

Hello and welcome!

 

There is no question too dumb for these forums, if there was I would have asked it already.

 

In regards to your question, that bit of code is a shortcut for reading an input pin on the Arduino:

 

http://www.arduino.c...ortManipulation

 

I think that's digital port 1 (thought I could be wrong). The equivalent for the Netduino would be to create a InputPort and use the .Read() method. Or, since it looks like it want to be an interrupt port, you could create an InterruptPort.

 

I hope that helps!







Also tagged with one or more of these keywords: mpr121, breakout, capacitive, conversion

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.