To use this file copy and paste this:
// #URL-lib "http://pin1.org/forthlib/flb/IASI/BV4103.flb" into BV Terminal 3
or here to download.
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// BV4103 LCD. This device is the same form a software point
// of view as the BV4108, the BV103 is a BV4108 with an LCD
// already attached.
// LCD are slow devixces and so expect to see delays in the
// software. This particular library expects the set up to have
// an ACK value of 6 and the configuration slot to be YNNNNNN
// if setup is used this will set the device to that
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// HISTORY:
// Feb 2008 - created new library
// CONSTANTS:
// Integers
integer address // holds device address
Full Contents of File
integer  address     
: ack?
    i-cbuff     
    address  i-address  cr1     
    i-in  6  =
;   
: setup
    i-zf       
    cr  ."  The  display  now  needs  to  be  reset  by  power  cycling  "
    cr  ."  press  any  key  when  done"
    key  drop
    cr  ."  Wait.."
    i-det  214  <>  abort"  There  is  a  problem:  device  not  set,  try  again"
    s"  ZK6"  stype1  cr1  200  ms    i-cbuff 
    s"  ZA"  stype1  addr  <#  #  #  #>  stype1  cr1  30  ms  i-cbuff 
    s"  ZB"  stype1  baud  iu.  cr1    600  ms  i-cbuff 
    s"  ZC6  -w  ynnnnnn"  stype1  cr1  1000  ms     
    i-det  dup  .  214  <>  abort"  Cant  reset  after  changing  config"
    s"  ZC6  -r  "  stype1  cr1 
    addr  =>  address
    ack?
    if
        cr  ."  set  up  sucess"
    else
        cr  ."  possible  problem  with  set  up"
        cr  ."  recycle  power  and  see  if  ACK?  returns  -1"
    then       
;
: wfa 
    cr1     
    -1     
    50  for 
        i-in  6  =  if  drop  0  leave  then 
    next   
    abort"  error" 
;
: ad 
    address  dup  0=  abort"  Address  has  not  been  setup" 
    i-address  ; 
   
: ba  ad  s"  BA"  stype1  iu.  wfa  ;   
: bli  ad  s"  BL"  stype1  iu.  wfa  ; 
: bm  ad  s"  BM"  stype1  iu.  wfa  ; 
: bn  ad  s"  BN"  stype1  iu.  wfa  ; 
: bp  ad  s"  BP"  stype1  iu.  wfa  ; 
: br  ad  s"  BR"  stype1  iu.  wfa  ; 
: bt  ad  s"  BT  "  stype1  34  emit1  stype1  34  emit1  wfa  ; 
: bx  ad  s"  BX"  stype1  iu.  wfa  ; 
: dh  ad  s"  DH"  stype1  wfa  ; 
: dl  ad  s"  DL"  stype1  iu.  wfa  ; 
: dr  ad  s"  DR"  stype1  iu.  wfa  ; 
: c-off&0c  bm  ; 
: c-blk&0d  bm  ; 
: c-nrm&0e  bm  ; 
: pnum 
    ad  s"  BT"  stype1  34  emit1  <#  #s  #>  stype1  34  emit1  wfa  ; 
: pnum2 
    ad  s"  BT"  stype1  34  emit1  <#  #  #  #>  stype1  34  emit1  wfa  ; 
: pnum4 
    ad  s"  BT"  stype1  34  emit1  <#  #  #  #  #  #>  stype1  34  emit1  wfa  ;