LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > General
User Name
Password
General This forum is for non-technical general discussion which can include both Linux and non-Linux topics. Have fun!

Notices


Reply
  Search this Thread
Old 08-08-2006, 03:40 PM   #1
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Rep: Reputation: 15
Is a mouse analog or digital?


Hey, I was just wondering if most mouse devices are analog or digital, specifically most optical mice?
Also, does anyone know if a Wacom Intuos2 (a stylus type input pad) is analog?

I have been trying to find out, but most of the user manuals I have looked at have not specified. (and a google search just returns pages about some one who's screen name is Analog Mouse, which is not what I need to know).
 
Old 08-08-2006, 03:58 PM   #2
slantoflight
Member
 
Registered: Aug 2005
Distribution: Smoothwall
Posts: 283
Blog Entries: 3

Rep: Reputation: 35
Mice are definately digital. Some people just find it amusing to use contradictory names like 98theMilleniumEdition, wildpartygeek, code-tan, userfriendly. You get the idea.
 
Old 08-08-2006, 04:01 PM   #3
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,614

Rep: Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340
Mice are digital devices.
It wasn't obvious from Wacom website how the pad connects to the PC but I assume its digital too.
 
Old 08-08-2006, 04:07 PM   #4
Chromezero
Member
 
Registered: Nov 2004
Location: Arizona
Distribution: Slackware, RHEL, others
Posts: 470

Rep: Reputation: 40
There is often some confusion about this, "is my joystick analog?", "my mouse is digital", etc. The signal that goes from your joystick or mouse is a digital signal. However, how the device inteperets movement is not necessarily digital. For example, with a digital joystick, movement to the left or right is either an on or off state. With an analog stick, you have a range of movement 0-100% left or 0-100% right, typically measured by a variable resistor or something similar. It's not just on or off, it could be 50% to the left, or 23% to the right. Hope that helps explain it a bit.

Edit:With newer technology, many devices such as an optical mouse are digital but they simulate an analog function. Although they may behave like an analog device, they are in fact digital.

Last edited by Chromezero; 08-08-2006 at 04:11 PM.
 
Old 08-08-2006, 04:07 PM   #5
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,348
Blog Entries: 8

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
It depends on what you mean by "digital". The signals from a mouse to the computer are pure digital. The sensor, however, is essentially a small grid array of analog light detectors. On board circuitry interprets the picture-like data to deduce horizontal mouse motion. That's why an optical mouse needs to operate on a surface with some visual "texture".
 
Old 08-08-2006, 04:14 PM   #6
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
The pad connects through USB (mine does, but you can also get it for serial).

I have a board that reads in analog data and outputs it to a binary file, it is used for psychophysical experiments that track eye movements. The machine regularly records eye movements on channels one and two, and the output of a photocell on three. I want to make the mouse or Wacom Intuos pad channel four, but it needs to be analog (I do not know why, but that is what I was told).
 
Old 08-08-2006, 05:31 PM   #7
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,614

Rep: Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340
From your description I assume your board is basically a 4 channel Analog to Digital Converter (ADC). It converts a voltage to a digital number and where I also assume some application writes this data to a file. Your pad/mouse output is already in digital form and so can not be directly connected to the ADC board. It sounds like you want your subject under test to follow some object on a monitor or the pad where you control it with a mouse.

I could not say how difficult it would be to create a new application that would be able to record a mouse xy position with the input from the ADC and being able to corelate the data without knowing the details of the board but I would guess that this isn't really an option. Actually all my ideas would require a new application.
 
Old 08-08-2006, 09:28 PM   #8
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
Ya, michaelk, you are about right with what I want to do. I have several dots on the screen and the user needs to point at each one with the cursor (in one experimental condition). In another condition the participant just looks at the screen, but to keep the stimuli the same I would like to have a mouse that is moving around the screen, and pointing at the dots. So I would like to record the mouse movements of the users in the first condition so that I can replay them during the second condition.

The display is coded in OpenGL, and I can use the mouseMotionFunc to get the mouse movements, but that will take more work than if I could have just plugged it into the data acquisition board, because the board would do everything I want if I just route the mouse output to the board. In OpenGL I will have to program in the correct sample rate and make sure that the mouse information file has enough information to play back at the correct time during the experiment. It should all be doable, but it will take more work, and the OpenGL program that runs the experiment is already bloated enough that I had hoped to get by without adding more to it.

Thank you all for the help!
 
Old 08-08-2006, 11:22 PM   #9
IsaacKuo
Senior Member
 
Registered: Apr 2004
Location: Baton Rouge, Louisiana, USA
Distribution: Debian 9 Stretch
Posts: 2,348
Blog Entries: 8

Rep: Reputation: 383Reputation: 383Reputation: 383Reputation: 383
Mouse output is not analog in the way you hope, but perhaps you can still minimize your effort by using an analog OUTPUT device which plugs into the board.

For example, the default "line out" of a sound card is two channels of analog voltage output. This can be plugged into your analog data acquisition board. Thus, the only modification required to your OpenGL program is to take the current XY mouse position and produce sound output accordingly.
 
Old 08-10-2006, 07:01 PM   #10
Napalm Llama
Member
 
Registered: Nov 2004
Location: Bristol, UK
Distribution: Gentoo 2005.0
Posts: 224

Rep: Reputation: 30
If you're just dumping the incoming data to a digitally-coded file, why not just use this command:

cat /dev/input/js0 > joystickfile

...where /dev/input/js0 is the device name of your joystick? (Not owning one, I don't know the applicable UDEV naming convention.)

Last edited by Napalm Llama; 08-10-2006 at 07:04 PM.
 
Old 08-11-2006, 09:00 AM   #11
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
I am actually doing this job at work, which runs windows, so I am not sure what the command would be to do that.
(I know this is a linux forum, but it is the forum I use for my personal questions, so at work it was the first forum I thought to ask at, I do not know any windows forums. And I thought that people here generally know their stuff)

Thanks for all your help, I think I may have a good way of going about this. I was tempted to work with the sound output idea by IsaacKuo, it was very creative, but one of my coworkers decided to try something, that I honestly don't understand, but it seems to be working.
 
Old 08-11-2006, 09:16 AM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,614

Rep: Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340
I would interested to know what your coworker came up with.
 
Old 08-11-2006, 10:36 AM   #13
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 9,078
Blog Entries: 4

Rep: Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170Reputation: 3170
The APIs in the Windows environment are very similar. If the device is plugged in as the mouse, then WM_MOUSEMOVE messages will be dispatched to the application. Otherwise, the device might present itself as (say) a four-serial-port card, or something similar. If you've got a driver for the thing, you're home free.

The data stream that will come into the computer is, of course, a digital one. It's a stream of discrete numeric values representing changes in the position of the pointer. Your software accumulates these values to track the movements.

The physical connection of the device to the computer's interface-card might be analog, in the sense that it is (say) variations in voltages coming in on a wire. This is transformed to digital data using an A/D converter. But for most devices these days, all that conversion circuitry is neatly packaged in the device itself, and what you've actually got coming into the machine is (say) a USB port and it's manifesting nice, neat, digital streams from its various sub-units.
 
Old 08-11-2006, 10:42 AM   #14
jdwilder
Member
 
Registered: Jul 2003
Location: United States
Distribution: Fedora Core 7 and older, Knoppix, Ubuntu
Posts: 121

Original Poster
Rep: Reputation: 15
@michaelk
I am not sure I understand it very well, but for what I do understand it seems very round-about way of doing this, and I am learning more about this stuff everyday (I have only been here two weeks and have never worked with hardware very much, so I was new to it all). Our program already reads in from a specified amount of analog channels and writes them to binary file. The reason they wanted to use the same system to write the mouse information is because all the files are synchronized, so we would know the exact time the data was taken. If we needed to use a different sytem for the mouse it meant we would have to code in our own sampling rate and synchronization, which woulnd't be that hard, but it would mean more coding. Now here is the part I don't understand, because from the way it sounds it is very simple, so I do not know why no one at work said to do this earlier. On our board we have two D/A channels (that is what the label says, I am not certain if they really change the signal to analog or not), that take a digital input and send a signal, and that same signal gets sent until a new signal is given. So what we did is send the x coord to one channel and the y to the other, and we discovered that a 0 coord gave a -10 volt signal, and a 1023 coord gave a -5. To make it more understandable I shifted over, so that a 0 would return a 0 and a 1023 would return a 5, so now we have a 1-1 mapping of pixels to voltage, which we sent to the analog channel and it writes it to the file. Since the analog channel is already synchronized with the clock and we know that it samples every two ms we can tell where the mouse was at (almost) each point in the trial. Now, in other trials we read in that file and reporduce the mouse movements for the user to see, so that the screen looks the same to the group that moves the mouse and the group that doesn't use a mouse. To me the idea seems simple enough that it should have been thought of by my coworkers right away, but I guess they are just busy are working on other projects more important than this one right now so I am left to do this stuff that I have no clue about (all I know I learned from Wikipedia, and from my intro to CS class 5 years ago).
 
Old 08-11-2006, 11:00 AM   #15
michaelk
Moderator
 
Registered: Aug 2002
Posts: 17,614

Rep: Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340Reputation: 2340
A digital to analog converter does indeed convert a number to a voltage. It depends on the specifications of the converter and how it is setup. If your converter is indeed 10 bits 0-1023 with a 5 volt range then each bit would be about .005 volts.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Simulink / Control Systems / (Analog/Digital) Time domain Simulation tasamy Linux - Software 1 05-24-2006 05:32 PM
Are most cheap headphones analog or digital? RHLinuxGUY Linux - Hardware 2 01-26-2006 09:08 PM
How to get both Analog and Digital sound at the same time tho_x_tran Linux - Hardware 1 08-12-2004 08:29 AM
.alsaconfig help > need default device from analog to digital xrn0id Linux - Software 3 08-11-2004 04:36 PM
SB Live 5.1 - loud background noise from center channel (digital/analog out) digital vortex Linux - Hardware 4 05-19-2004 01:56 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > General

All times are GMT -5. The time now is 12:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration