Joystick mouse?

15 views
Skip to first unread message

Hans van Veldhuizen

unread,
Dec 31, 2024, 4:55:59 AM12/31/24
to jallist
Joystick mouse?
Hello everyone,
Instead of a mouse, the cursor on a pc can also be controlled with a joystick according to arduino. Is there anyone who has already done this in the JAL world?
greetings
Hans

Rob CJ

unread,
Dec 31, 2024, 7:01:49 AM12/31/24
to jal...@googlegroups.com
Hi Hans,

I assume you mean a joystick via a USB port?

There is no library for a USB Joystick in JAL (at least not in the release, not sure if somebody made one for themselves) so a library should be created then but that will depend on the joystick being used I assume.

Kind regards,

Rob




Van: jal...@googlegroups.com <jal...@googlegroups.com> namens Hans van Veldhuizen <hanz...@zeelandnet.nl>
Verzonden: dinsdag 31 december 2024 10:55
Aan: jallist <jal...@googlegroups.com>
Onderwerp: [jallist] Joystick mouse?
 
--
You received this message because you are subscribed to the Google Groups "jallist" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jallist+u...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/jallist/f6025fb1-6485-4ca9-9f16-8f72d96f704bn%40googlegroups.com.

Hans van Veldhuizen

unread,
Dec 31, 2024, 8:39:42 AM12/31/24
to jallist
Hello Rob,
This is a type that can be read with an ad, just two potentiometers20241231_143325[1].jpg

Op dinsdag 31 december 2024 om 13:01:49 UTC+1 schreef Rob CJ:

Rob CJ

unread,
Jan 1, 2025, 4:03:45 AMJan 1
to jal...@googlegroups.com
Hi Hans,

I had to look it up but it seems that the VRx and VRy pins can be read using the ADC since it seems to output just analog voltages.

So you can build it when using the ADC library.

Kind regards,

Rob


Verzonden: dinsdag 31 december 2024 14:39
Aan: jallist <jal...@googlegroups.com>
Onderwerp: Re: [jallist] Joystick mouse?
 

Hans van Veldhuizen

unread,
Jan 1, 2025, 6:52:37 AMJan 1
to jallist
Hello everyone,
First of all, best wishes for 2025.
Rob,
I have used this joysticjk before, works perfectly. For my question I found some things in Bert's book 50 Pic Microcontroller projects chapter 9.5, 9.6, 9.7.
Is this not convertible to the Jallib?

Op woensdag 1 januari 2025 om 10:03:45 UTC+1 schreef Rob CJ:

Rob CJ

unread,
Jan 1, 2025, 10:22:07 AMJan 1
to jallist
Hi Hans and others,

The best wishes for 2025.

@Hans. I do not have the book you mention (I have another book of Bert van Dam but that does not mention anything in these chapters).

What do you want to do? Do you want to control  your mouse cursor with this joystick? I assume via an USB connection.

If so then you have to do the following:
  1. Write a program that reads the joystick using the ADC
  2. Include the JAL library usb_mouse.jal in your program
  3. Convert the ADC values that you read into mouse movements (function usb_mouse_move). Have a look at one of the USB mouse sample programs.
You need of course a PIC with USB hardware on board.

Good luck!

Kind regards,

Rob



Verzonden: woensdag 1 januari 2025 12:52

Hans van Veldhuizen

unread,
Jan 1, 2025, 11:01:06 AMJan 1
to jallist
Hi Rob, phew, I hadn't discovered that the files I indicated were already in the jallib's. I can continue now. Thanks again.
greetings
Hans

Op woensdag 1 januari 2025 om 16:22:07 UTC+1 schreef Rob CJ:
Reply all
Reply to author
Forward
0 new messages