----- Original Message -----
From: "slavko milekic" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, May 03, 2001 5:57 PM
Subject: MC and outside world


>
> I am trying to use MC for student projects in building innovative
ways of
> interacting with the outside world.  I have come across serial
port-based
> IO card called EZIO  (www.ezio.com) -- there is an example stack for
> HyperCard but I need to use it on a Windows machine.  Any guidelines
for
> converting the HyperCard stack (and external)  to MC (and DLL) on
Windows
> platform would be greatly appreciated!


It's very possible that I misunderstand what's involved here, but I'm
not sure you need the DLL or anything found in the Hypercard stack.
The EZIO API tells exactly what data is needed to control what EZIO
functions, so... have you tried writing and reading directly to/from a
Windows COM port?

Examples:

1) init serial port to 57600 bps, 8 data bits, 1 stop bit, no parity
bit
   MC:
   set the serialControlString to "BAUD=57600 PARITY=N DATA=8 STOP=1"

2) get an analog to digital conversion:
   API instructions:
   send out "A" (ascii 65)
   send out line number as ASCII character, range= 0 through 7
   read back the result, which will be an ASCII char from 0 to 255
   MC:
   open file "COM1:" for update
   write "A" & tSomeLineNumber to file "COM1:"
   read from file "COM1:" for 1 char
   put it into tEZIOresponse
   close file "COM1:"

3) set the pulse-width-modulation duty cycle (PWM)
   API instructions:
   send out "P" (ascii 80)
   send out line number as ASCII character, range=0 through 1
   send out the duty cycle as two chars/bytes, high byte first, then
low byte, to make a 10-bit number (zero through 1023). For example: to
set the duty cycle to 100% (full on), send out ascii 03 in the high
byte, followed by ascii 255 in the low byte.
   MC:
   open file "COM1:" for write
   write "P" to file "COM1:"
   write tSomeLineNumber to file "COM1:"
   write numtochar(3) & numtochar(255) to file "COM1:"
   close file "COM1:"

In example 3, you may wish to use the "binaryEncode" and
"binaryDecode" functions to create the send string, instead of doing
it the way shown here.

If you pursue this, please let us know if you get it to work. I've
never used EZIO, I just went to their web site and read their stuff.

Phil Davis


>
> Slavko Milekic
> -----------------------------------------
> Slavko Milekic, M.D., Ph.D.
> Assoc. Prof. of Cognitive Science & Digital Design
> Dept. of Art Education & Art Therapy
> The University of the Arts
> 320 S. Broad St., Philadelphia, PA 19102
>
> tel: 215-717-6052 fax: 209-844-9704
> [EMAIL PROTECTED]
> http://www.uarts.edu/faculty/smilekic
> -----------------------------------------
>
>
> Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
> Info: http://www.xworlds.com/metacard/mailinglist.htm
> Please send bug reports to <[EMAIL PROTECTED]>, not this list.
>
>


Archives: http://www.mail-archive.com/metacard@lists.runrev.com/
Info: http://www.xworlds.com/metacard/mailinglist.htm
Please send bug reports to <[EMAIL PROTECTED]>, not this list.

Reply via email to