Netduino home hardware projects downloads community

Jump to content

The Netduino forums have been replaced by new forums at This site has been preserved for archival purposes only and the ability to make new accounts or posts has been turned off.

Turn on onboard LED with PC Keyboard.

visual studio pc keyboard c# gui

  • Please log in to reply
4 replies to this topic

#1 orenduino



  • Members
  • PipPip
  • 26 posts

Posted 10 February 2014 - 02:56 PM


I am a new to the NETDUINO (and c#)

So far it looks great, I am looking forward to study and do great things with it.

Currently, I own a NETDUINO (or NETDUINO 1).


I have search the web, but I did not found a solution.

Let me introduce my problem as simple as I can.

in order to interact the hardware in realtime,



I'd like to be able to turn the onboard led on and off by clicking the SPACE button on my PC keyboard.

I'd like to integrate the Netduino with a standard c# Console program.

something like this:

static void main(){for (int i = 0; i<10 ; i++) {    console.readkey();       // wait for a keypress on my PC keyboard   turn_on_led_function();  // a function that turns the onboard led on   console.readkey();       // wait for a keypress on my PC keyboard   turn_off_led_function(); // a function that turn the onboard led off   console.writeline("{0}", get_button_status()); //bool read the button status}}

is this kind of code possible anyway ?

Can you help me with the LED and  BUTTON functions ?




#2 perpetualKid



  • Members
  • PipPip
  • 20 posts

Posted 12 February 2014 - 07:44 PM

there is no out of the box option to interact from PC to the device at runtime, the USB connection is only used upload new firmware/programs.

You can use the Onboard button in the way you described, instead of PC Console input. The easiest way is to poll the Button or use an Interrupt. If you want interaction with PC, the next simple option is using Serial (UART) communication. As most recent PC's don't have serial anymore (and would also require level converter due to different voltage levels), recommend using a "USB to Serial" module on the PC end, or an Serial to Bluetooth module on the Netduino. Should be few bucks only for the module in either option.

#3 baxter


    Advanced Member

  • Members
  • PipPipPip
  • 415 posts

Posted 14 February 2014 - 12:11 AM

You might take a look at the MCP2210 USB to SPI module, http://www.embeddeda...spi_module.html http://www.microchip...ocName=en556614


Microchip supplies a prebuilt PC terminal to interact with it and also, a PC DLL to write your own code.You could use either the module GPIO pins or SPI to interface with Netduino.

#4 orenduino



  • Members
  • PipPip
  • 26 posts

Posted 15 February 2014 - 11:46 AM

Thank you for your answers perpetualKid and Baxter.

The MICROCHIP might be interesting, I will check this further. Thank you


regard the UART communication

Basically, I need to read/write tables of data from/to the FLASH Memory (Or RAM).

and initiate functions whenever writing data is done completely.

do you know any examples for this ?  (writing to flash/RAM through COM, trigger an event through com, etc)




#5 lifanek



  • Members
  • PipPip
  • 23 posts
  • LocationKatowice, Poland

Posted 15 February 2014 - 05:02 PM

Check out my code here http://forums.netdui...ces/#entry56074 - maybe You will find there some useful info.

Also tagged with one or more of these keywords: visual studio, pc, keyboard, c#, gui

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.