USB HID Joystick for Dummies


Closed Thread
Results 1 to 22 of 22

Hybrid View

  1. #1
    Join Date
    Jun 2009
    Posts
    3

    Default flavour of picBASIC addendum

    OK
    it is
    Dim dog As Byte 'Proton+


    cheers.
    Gordon.

  2. #2
    scumari's Avatar
    scumari Guest

    Default Make a joystick

    After reading the guide carefully and preparing the code, while compiling, i get varios errors about Simbols not previously defines.
    this happens with USBDeviceInit, USBDeviceTasks GetUSB and PutUSB???

    Should something be included here and what??

    Thanx

  3. #3
    scumari's Avatar
    scumari Guest

    Default Make a joystick

    Found a work arround.
    Copy the hid_desc.bas file and all associated files to your working directory.
    Copy the text made by DT.exe and changed by the ways of the Dummy Manual, into the 'ReportDescriptor1' part, overwriting existing code.

    This should do the trick.
    By this way I created a 6 axis,16 button pedestal.

    Have fun

    More MCU and other projects:
    http://www.scumari.nl/www/mcu
    Last edited by scumari; - 3rd November 2010 at 09:18.

  4. #4
    Join Date
    Sep 2009
    Posts
    737

    Default

    Can you upload project or pbp code and descriptor file?

  5. #5
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818

    Default

    Quote Originally Posted by scumari View Post
    Found a work arround.
    Copy the hid_desc.bas file and all associated files to your working directory.
    Copy the text made by DT.exe and changed by the ways of the Dummy Manual, into the 'ReportDescriptor1' part, overwriting existing code.

    This should do the trick.
    By this way I created a 6 axis,16 button pedestal.

    Have fun

    More MCU and other projects:
    http://www.scumari.nl/www/mcu
    A better way is to "INCLUDE" the file like so . . .
    Code:
    INCLUDE "hid_desc.bas"
    The file MUST be in the same directory as the program you are writing.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  6. #6
    Join Date
    Feb 2005
    Location
    Holmfirth England
    Posts
    116

    Default Re: USB HID Joystick for Dummies

    Hi,

    I have got my usb joystick working, but my axis starts in the centre moves to the right, to the left side then back to the centre as i increase the pot.

    I am doing a simple "adcin, 0, USBBuffer[0]" as in your example.
    I tried shifting the result 4 bits to the left but this just mixes it up onto 2 axes.
    What am I doing wrong?

    Doh, all i had to do is add 128 to the result, boy do i feel foolish :-)

    Regards
    Bob...
    Last edited by BobEdge; - 21st April 2011 at 16:23.

  7. #7
    Join Date
    Jun 2005
    Location
    Penang
    Posts
    40

    Default Re: USB HID Joystick for Dummies

    Hello all,

    I am trying to convert my old joystick to USB Joystick.Since i am kinda new to USB,i plan to take this advantage to learn how USB works.I have tried CDC before & now HID.As a starting point,i searched for a example code & bumped to a site (www.starlino.com),an accelerometer based joystick.I downloaded the codes (which is in PBP) & researched the codes.After going through the USBDesc & tried the code (which worked very well) & i plan to expand it from original (2 Axis & 6 Buttons) to 3 Axis,Throttle & 8 buttons.I have modified the USBDesc & added some lines in source.To my suprise it connects to the computer (ting tong) & showed the axis,throttle & buttons in the gamepad configuration but it freeze in there.Whenever i press any of the buttons,i didn't work..i mean nothing happened.I have tried few methods but didn't work.Can anyone help me??.Attached codes together.

    *PS - The attached code is only for x,y,z axis & buttons.

    You help is kindly appreciated
    Attached Files Attached Files

  8. #8
    Join Date
    Jun 2005
    Location
    Penang
    Posts
    40

    Default Re: USB HID Joystick for Dummies

    Hello all,

    Sorry.The above attached USBDesc have throttle & not Z axis.I have modified few of them but the result are the same.No response.One way around the Buttons should work,but in my case none of it is working.

Similar Threads

  1. USB hid maker help please.
    By BobEdge in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 3rd April 2013, 14:49
  2. Simple USB Comms Problem
    By awmt102 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 6th January 2010, 20:17
  3. USB MSD with HID code ?
    By Chris Barron in forum USB
    Replies: 1
    Last Post: - 11th November 2009, 17:33
  4. i cant get 18f2550 work as HID
    By Ahmadabuomar in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 13th October 2009, 16:39
  5. Replies: 0
    Last Post: - 6th March 2009, 07:52

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts