To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/IASI2/BV4113-motor.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// BV4113 - IASI stepper motor driver 'a'
// This will load as a stand alone file or can be used as a library
// providing the parent file includes the files in the REQUIRES
// section
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// HISTORY:
// Jan 2009 *Preliminary
// *not complete only has step and a few other commands
// REQUIRES:
// #URL-lib "http://pin1.org/forthlib/flb/General/soft1.flb" sid=0
// #URL-lib "http://pin1.org/forthlib/flb/General/pinsel.flb" sid=101
// #URL-lib "http://pin1.org/forthlib/flb/General/strings.flb"
// #URL-lib "http://pin1.org/forthlib/flb/IASI2/IASI2-motor.flb"
// CONSTANTS:
integer i-motor-adr // set this before using
Full Contents of File
integer  i-motor-adr         
: i-set-motor-adr
        =>  i-motor-adr
; 
     
: i-init-motor
        i-set-motor-adr
        i-connect
;                       
: m-setdigit
        i-motor-adr  emit1  [char]  d  emit1 
        channel  1  = 
        if
                [char]  a  emit1  [char]  -  emit1
                output  1  =
                if
                          [char]  o  emit1  cr1  i-send
                else       
                          [char]  i  emit1  cr1  i-send
                then
        else                 
                [char]  b  emit1  [char]  -  emit1
                output  1  =
                if
                          [char]  o  emit1  cr1  i-send
                else       
                          [char]  i  emit1  cr1  i-send
                then
        then
;
: m-digit
        i-motor-adr  emit1  [char]  d  emit1 
        channel  1  = 
        if
                set  1  =
                [char]  a  emit1
                if
                        [char]  1  emit1  cr1  i-send
                else
                        [char]  0  emit1  cr1  i-send
                then
      else                 
                set  1  =
                [char]  b  emit1
                if
                        [char]  1  emit1  cr1  i-send
                else
                        [char]  0  emit1  cr1  i-send
                then
      then
;
: m-get
        i-cbuff
        i-motor-adr  emit1  [char]  d  emit1 
        channel  1  =
        if
                [char]  a  emit1
        else
                [char]  b  emit1
        then
        cr1  i-send  i-gn  drop
;                       
: m-analogue 
        i-cbuff
        i-motor-adr  emit1  [char]  v  emit1 
        percent  1  =
        if
                [char]  p  emit1
        then
        cr1  i-send  i-gn  drop
;                       
: m-step
        i-motor-adr  emit1 
        steps  -1  =
        if
                [char]  r  emit1 
                direction  48  + 
                emit1  cr1  i-send 
                i-motor-adr  emit1 
                [char]  c  emit1  cr1  i-send
        else
                [char]  n  emit1
                direction  48  + 
                emit1  cr1
        then       
;
                               
: m-stop
        i-motor-adr  emit1  [char]  x  emit1  cr1
;
: m-speed
        i-motor-adr  emit1  [char]  s  emit1
        speed  iu.  cr1
;
       
: m-mode
        i-motor-adr  emit1  [char]  h  emit1
        mode  1  =
        if
                [char]  f  emit1
        else
                [char]  h  emit1
        then
        cr1               
;