I'm quite new her so sorry if i make something wrong^^
I wantedt to make a ps/2 mouse out of my Arduino with this Library: ww_w.arduino.cc/playground/ComponentLib/Ps2mouse
(the link is changed because it's my first comment.)
Now startet Arduino 0018 and started the example from the Library.
But when I try to compile it it says:
c:/dokumente und einstellungen/.../arduino-0018/hardware/tools/avr/lib/gcc/../../avr/include/stdlib.h:111: error: expected `)' before 'int'
Now I downloaded the Arduino enviroment 0012 because it was used on the site from the library. But when I try to start it with the run.bat it gives me this error masage:
Stable Library
=========================================
Native lib Version = RXTX-2.1-7
Java lib Version = RXTX-2.1-7
Exception in thread "main"
java.lang.NumberFormatException: null
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at processing.app.Preferences.getInteger(Preferences.java:750)
at processing.app.Editor.restorePreferences(Editor.java:420)
at processing.app.Base.<init>(Base.java:155)
at processing.app.Base.main(Base.java:104)
now I tried to start the .exe file directly but nothing happens
only the process in the Task manager doesent dissapear and it uses more and more space but without effect for hours :-/.
Does someone know how to make a ps/2 mouse out of the Arduino with the 0017-0021?? Or can someone say me how to start it.
I put the Library right ther and I put it in the Arduino\libraries folder.
But when I run it with 0018 or 0021 it returns the same error massage described below :'(.
I can add the library over:
sketch-->import Library-->ps2dev
so I think the Library is in the right place.
Doesen't anyone know how I can start the 0012?
If it helps I'm using xp.
The steps that I showed result in successful compilation on my Windows XP workstation with arduino-0021. I would not have posted if I had not tested on my system.
Maybe your download or unzipping resulted in a corrupted library???
What kind of messages do you get in the console window of arduino-0021 when you hold down a "Shift" key when compiling?
In file included from C:\Dokumente und Einstellungen\Nutzer\Desktop\Programmieren\Java\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:6,
from C:\DOKUME~1\Nutzer\LOKALE~1\Temp\build9053873873924970999.tmp\ps2_mouse.cpp:4:
c:/dokumente und einstellungen/nutzer/desktop/programmieren/java/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
c:/dokumente und einstellungen/nutzer/desktop/programmieren/java/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
c:/dokumente und einstellungen/nutzer/desktop/programmieren/java/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
This is the red part of the log only because the hole one is to long.
Perhaps you can send me your MD5 Cheksum of your .zip folder.
My one is: 66830F19F83B628E5214ED0BDE8B1893
Not that we understand wrong I want to emulate a mice with the Arduino and not connect a mice to the Arduino. And for that I use the Library of the bottom from the page below.
(I added a blank line between commands to make it a little more readable.)
Regards,
Dave
Footnotes:
[1] I am assuming that you can compile and execute other example sketches with arduino-0021
[2] I haven't actually tried to see whether the ps2 mouse stuff actually works; I just wanted verify that it can be compiled with arduino-0021 on my Windows XP workstation.
After a little head-scratching and trying to figure out where I had seen errors like you see, here's what I remembered:
If a library program includes other core library headers before it includes WProgram.h you can get that error.
For example, here's what the beginning of ps2.h looks like:
/*
* ps2.h - a library to interface with ps2 devices. See comments in
* ps2.cpp.
* Written by Chris J. Kiick, January 2008.
* Release into public domain.
*/
#ifndef ps2_h
#define ps2_h
#include "WProgram.h"
class PS2
{
.
.
.
This compiles normally.
If you include, say, "WConstants.h" before "WProgram.h" you get error messages like the ones you are seeing.
In file included from H:\ftp\arduino\arduino-0021\hardware\arduino\cores\arduino/WProgram.h:6,
from F:\home\dave\Arduino\libraries\ps2\/ps2.h:11,
from F:\home\dave\Arduino\libraries\ps2\ps2.cpp:12:
h:/ftp/arduino/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected unqualified-id before 'double'
h:/ftp/arduino/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
h:/ftp/arduino/arduino-0021/hardware/tools/avr/lib/gcc/../../avr/include/math.h:439: error: expected `)' before 'double'
Maybe that is what older arduino distributions needed or tolerated, but not these days. All you need is WProgram.h. It takes care of the other stuff.
So:
Use arduino-0021
Make sure you have the latest ps2.zip. Unzipped files have date 01/29/2008.
In ps2dev.h, comment out the line that includes WConstants.h. Put in a lline that includes WProgram.h:
/*
* ps2dev.h - a library to interface with ps2 hosts. See comments in
* ps2.cpp.
* Written by Chris J. Kiick, January 2008.
* modified by Gene E. Scogin, August 2008.
* Release into public domain.
*/
#ifndef ps2dev_h
#define ps2dev_h
//#include "WConstants.h" // The original line---for really old arduino stuff
#include "WProgram.h" // This is what you should have for arduino-0021
class PS2dev
{
.
.
.
With that change I find that arduino-0021 compiles it without problems.
but when I connect the data and the clock wires from a ps/2 cable to the pc and to the arduino on digital pin 3 and 2 the Arduino doesn't starts anymore :'(. And when I reset it my pc says that the connected hardware isn't ok and I don't see the com port of it. When I disconnect the ps/2 wires and reset it it works fine again :-?