home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!dtix!darwin.sura.net!mips!sdd.hp.com!hpscdc!cupnews0.cup.hp.com!hppad.waterloo.hp.com!hppad!hpfcso!stroyan
- From: stroyan@hpfcso.FC.HP.COM (Mike Stroyan)
- Newsgroups: comp.sys.hp
- Subject: Re: hp730 <- Digitizer: Communications Library Wanted
- Message-ID: <7371174@hpfcso.FC.HP.COM>
- Date: 27 Jul 92 23:02:38 GMT
- References: <Bs2B9q.JGF@news.cso.uiuc.edu>
- Organization: Hewlett-Packard, Fort Collins, CO, USA
- Lines: 91
-
- > I have an hp 730 and a hp 46087b Digitizing Tablet (that's a HP-HIL
- > device, like a mouse or a keyboard).
- >
- > I would like to find a library (c or fortran) that could facilitate
- > command/control/data extraction from this device. I am aware that
- > I could write my own c routines to do this, but there must be a faster
- > way a better way than my c skills allow.
-
- The Starbase library will perform input from the tablet. It has calling
- conventions for both c and fortran. The following examples do simple
- input from a tablet. The program
- waits for ten button presses and reports the position of each one.
-
- The examples assume a device file called "/dev/tablet" exists for the
- tablet. The files /dev/hil1 through /dev/hil7 are created by default.
- The number corresponds to the position in the HP-HIL chain, starting
- from 1. Nine-knob boxes count as three devices. You could link one of
- the existing device files to "/dev/tablet", or change the programs to
- use one of the existing files.
-
- The Starbase library also has a sample_locator call for reading the
- tablet position without waiting for a button press.
-
- cc -o request request.c -lsb -ldld
-
- f77 -o request request.f -lsb -ldld
-
- # This is a shell archive. Remove anything before this line,
- # then unpack it by saving it in a file and typing "sh file".
- #
- # Wrapped by stroyan at hpfcso on Mon Jul 27 16:53:20 1992
- #
- # This archive contains:
- # request.c request.f
- #
-
- LANG=""; export LANG
-
- echo x - request.c
- cat >request.c <<'@EOF'
- #include <starbase.c.h>
- main()
- {
- int tablet, valid, i;
- float x=0.5, y=0.5, z=0.0;
-
- tablet = gopen("/dev/tablet", INDEV, "hp-hil", FALSE);
- if (tablet == -1) exit();
-
- for (i=1; i<=10; i++) {
- request_locator(tablet, 1, 200.0, &valid, &x, &y, &z);
- printf("valid: %d, x: %f, y: %f, z: %f\n", valid, x, y, z);
- }
-
- gclose(tablet);
- }
- @EOF
-
- chmod 660 request.c
-
- echo x - request.f
- cat >request.f <<'@EOF'
- include '/usr/include/starbase.f1.h'
- program main
- include '/usr/include/starbase.f2.h'
-
- integer tablet, valid, i
- real x, y, z
-
- x = 0.5
- y = 0.5
- z = 0.0
-
- tablet = gopen('/dev/tablet'//char(0), INDEV, 'hp-hil'//char(0), FALSE)
- if (tablet .EQ. -1) stop
-
- do i=1, 10
- call request_locator(tablet, 1, 200.0, valid, x, y, z)
- write(6,*) 'valid: ', valid
- write(6,*) 'x: ', x
- write(6,*) 'y: ', y
- write(6,*) 'z: ', z
- end do
-
- call gclose(tablet)
- end
- @EOF
-
- chmod 660 request.f
-
- exit 0
-