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

Using Arduino Mega as I/O expander


  • Please log in to reply
5 replies to this topic

#1 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 17 April 2013 - 08:01 AM

Hello,

 

I'm wondering about using Arduino Mega as I/O expander for my Netduino Plus. Has someone tried to connect this two boards to achieve similar scenario?  I know that I can use various of ways to expand Netduino I/O ports but most of them require board making and soldering and I don't have skills for that and my free time is very limited. Arduino Mega on the other hand has 54 I/O ports which is great and clean solution for me.

 

Regards



#2 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 17 April 2013 - 10:20 AM

yes you can do that. spi, i2c and serial are possible ways todo so.

 

yes i allready connected netduino with arduino, i used the arduino as "graphiccard" -

and in anohter test as webserver. io is also possible, i used serial for communications, but spi

would be way fast.



#3 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 17 April 2013 - 10:53 AM

Thanks for response. Any chance for some example code or some place where I should look for integration code?

 

Regards



#4 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 17 April 2013 - 11:22 AM

well, fist you have to get familiar with some arduino libs, like hardwasre serial and the pin functions (if you wanna more, than more ^^)

 

its very very simple: you open a serial connection on both, ar- and net- duino.

 

from the netduino you send like: byte1(identifier - like this byte means pin on off swichting) byte2(wich pin) byte3(value on/off / 0/1)

 

so you send like 0x07 0x01 0x00

 

on the arduino side you read the serial data, and process it. if(firstbyteReceieved == 0x07) { (look_at_second_byte) { turn_on_or_of_depending_on_thrid_byte } }

 

:D



#5 GrZeCh

GrZeCh

    Member

  • Members
  • PipPip
  • 29 posts
  • LocationPoland

Posted 18 April 2013 - 01:02 PM

Wouldn't it be easier to use SerialPort connection?



#6 NooM

NooM

    Advanced Member

  • Members
  • PipPipPip
  • 490 posts
  • LocationAustria

Posted 18 April 2013 - 01:20 PM

that was a sample, and it works for serial, spi, and ic2.

 

i myself use serialport.






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.