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! =)