Main Site Documentation

Can't create computer GUI for gadgeteer


Hi all!
I wish to use the VS2010 form in order to create GUI which controls the gadgeteer.
To do so, I created a project for my Hydra which works fine.
Next, I created a new project using the “Window Forms Application” and then referenced it to the first one and then got some errors:

“The project ‘MyForm’ cannot be referenced. The referenced project is targeted to a different framework family (.NETFramework)”


“There was a mismatch between the processor architecture of the project being built “MSIL” and the processor architecture of the reference “C:\Hydra\MyForm\bin\Debug\MyForm.exe”, “x86”. This mismatch may cause runtime failures. Please consider changing the targeted processor architecture of your project through the Configuration Manager so as to align the processor architectures between your project and references, or take a dependency on references with a processor architecture that matches the targeted processor architecture of your project.”

How can I overcome this problem? Or alternatively, any suggestion on how to create GUI that allows the user control the gadgeteer from pc?

Also, can’t use the Console.WriteLine();
(The name ‘Console’ does not exist in the current context )

Thanks in advance.


These two projects have to be independent. To do communication between one app and another you would typically use serial communication (over Bluetooth, over CDC, or over another serial link technology). is a good example of this.


I would use the usb.
But what about my questions?


So, I can’t control the hydra via the usb port on the red card (the same usb that supply power to the device) ?


I would try this module in your case:

or if you want power at the same time:


But the question remains, how can i build a GUI to control the gadgeteer from the computer?


Like you build any other GUI, but in your event handlers you will need to send data over ComPort and you will need code on Hydra to receive the data from the com port.


If this is with the Hydra, then try Debug.Print

As you have the Hydra and probably don’t have any wireless modules, serial (UART) with a suitable interface to convert to RS232 voltage levels will eb the cheapest and most suitable option. It all depends on what you are intended the Hydra and PC to do.

You can connect the PC to the Hydra this way and if your PC has no RS232, just get a USB to RS232 and or if you want a direct connection without having to get a Hydra RS232 breakout, you can use a USB to TTL converter like this.

The outputs from this will connect direct to the Hydra and give you a serial connection from your PC GUI.


NETMF is a slimed down version of the .NET Framework. The reason you are getting the errors is because the compiler is trying to build desktop code for an embedded device. If you wish to control the mainboard from windows, then you will need to choose a communications type, such as serial, like @ Architect suggested. Create your GUI to run from Windows, create a new project for the Gadgeteer side of things and build a string parser for your commands. The GUI would then send serial data to the Gadgeteer mainboard such as “W:14:1” (‘W’ for write, pin ‘14’, ‘1’ for on and ‘0’ for off) then have the gadgeteer mainboard parse this command and act accordingly. This will be the route with the smallest learning curve in my opinion.