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

Netduino Plus + Windows Form + Ethernet


  • Please log in to reply
1 reply to this topic

#1 Björn Nilsson

Björn Nilsson

    New Member

  • Members
  • Pip
  • 7 posts

Posted 01 August 2011 - 07:27 PM

Posted Image


Hi,

Thanks to some very helpful guys in my previous thread; I've created a small Windows Form Program that sends commands to the digital outputports using text Strings over a cross-over cat5 cable.The intention? Just to learn a bit about NETMF as I go along. :)

It's a simple(!!) program that so far only handles two methods
1. ONOFF: Turn on/off GPIO_PIN_DX (for all DIOs)
2. PULSE: ON/OFF GPIO_PIN_DX (only implemented for ONBOARD_LED in this example).
(no input methods so far)

My Windows Form Application sends messages that looks something like this: "METHOD@TARGET#variable1/variable2/,..."
to my N+ which interpret the Message as:

"What do you want? (before '@')
"Where does it belong? (before '#')
"What do I get to play with?(variables separated by '/')

The N+ then decides which method to execute and which Digital OutputPort to execute on.

The Socket part (NDPConnect) I got lots of help with on this forum (see prev. thread). Thanks guys! The rest of my jibberish is free for all to play with.

In advance; I beg your pardon for any silly coding, I've only been a C# programmer for 2 weeks and will probably make some real programmer on the other side of the globe cry upon reading this.
My intention is to share what I've learned so far with those new to the game :)

I've also tried playing a bit with servo motors using the same concept and it seems to be working as well. The next step I think will be trying to read data from in Digital input ports... should be basically the same thing... only backwards.

P.S I've only tried the outputports with LEDs. Please remember to use resistors if you do the same.
P.P.S you have to set the IP and Port of the N+ manually in both programs. I've been running on a static IP and crossover cable. i.e. no DHCP or Router.

Hope this might help somebody; Cheers! =)

Attached Files



#2 TareqGamal

TareqGamal

    Member

  • Members
  • PipPip
  • 19 posts

Posted 07 June 2014 - 04:33 PM

I want to add comment I faced after taying this code with my netduino plus 2 , v4.3

because the code is little old .

 

the code is working fine at your assembly ,

but I created my own .. after some errors and fixes ,

 

I faced an error message in the following statement:

I face Error message on this line :

servo = new PWM((Cpu.Pin)pin);

// See what the Netduino team say about this...

------

 

I found that you have to use Microsoft.SPOT.Hardware.PWM

to prevent  errors.

 

like this article :

 

http://netmftoolbox....om/workitem/473

 

I hope this help others.






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.