C# send Joystick data to arduino RRS feed

  • Question

  • Hi need some help with an C# sketch that can read joystick axis and 12 joustick buttons and send them to my Arduino.

    I have used this sketch(see link 1) as a base, but it only outputs the y-axis and its sending all the time.

    Can you guys help me with a code that only sends alterations.
    eks: output = 1(servo-number),123(servo-state),

    or if its possible to do a string with all in.
    eks: output = 123(servo1-state),123(servo2-state),123(servo3-state),123(servo4),and 12buttons.

    I have started with this as a base: http://code.google.com/p/stepperseri...t.zip&can=2&q=(I had to modify the sketch to get throttle working.)

    u can see it running on youtube: http://code.google.com/p/stepperseri...t.zip&can=2&q=

    • Moved by Leo Liu - MSFT Friday, March 18, 2011 2:58 AM Off-topic (From:Visual C# General)
    Friday, March 11, 2011 9:25 PM

All replies

  • Are you using the Netduino with the .NET micro-framework or the original Arduino and the supplied IDE?

    If you are using the original, it isn't actually C# you write the sketch with, (it is similiar) 

    Saturday, March 12, 2011 2:23 AM
  • im using the Arduino Uno.

    Im only hoping to use C# to read data from the USB Joystick that is connected to my laptop, then transfere it to my arduino on a different USB port.
    on my arduino Im using a arduino sketch that is in c+, and that end is working=)

    I need the c# sketch to look for alterations on the joystick and output new values as this:

    255(start),1(servo#),100(servo position)

    I think this is the best way of sending serial data to the arduino card?

    Saturday, March 12, 2011 2:33 PM
  • The Microsoft Robotics - Community Forum may be a better place for you to get specific advices in, I think.
    Please repost your thread there for better support.
    Then I will move your thread into the Off-topic Forum shortly, thanks.
    Leo Liu [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Monday, March 14, 2011 7:56 AM