Sample Code :
'  =========================================================================
'
'   File....... CompRepeater.BS2
'   Purpose.... Repeater program for Azimuth 1000 digital compass.
'   Author..... O.A.A
'   E-mail..... info@osmanardali.com
'   Started.... 01 Dec 2005
'   Updated....
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
datain            PIN         0    ' "SEROUT" from another BS1/BS2 module
NMEAin            PIN         1    ' NMEA Data
pindp1            PIN         2
pindp2            PIN         3
pin1A             PIN         4
pin1B             PIN         5
pin1C             PIN         6
pin1D             PIN         7
pin2A             PIN         8
pin2B             PIN         9
pin2C             PIN        10
pin2D             PIN        11
pin3A             PIN        12
pin3B             PIN        13
pin3C             PIN        14
pin3D             PIN        15
' -----[ Constants ]-------------------------------------------------------
Baud           CON     16572       ' 4800 baud , no parity , inverted
' -----[ Variables ]-------------------------------------------------------
digit           VAR         Nib
Bearing         VAR         Word
' -----[ Initialization ]--------------------------------------------------
DIRB = %1111                    '  ones digit
DIRC = %1111                    '  tens digit
DIRD = %1111                    '  hundreds digit
' Segment test
    DIRD = %0000
    DIRC = %0000
    DIRB = %0111
    PAUSE 100
    DIRD = %0000
    DIRC = %0111
    PAUSE 100
    DIRD = %0000
    PAUSE 100
    DIRB = %1111 : DIRC = %1111 : DIRD = %1111
' -----[ Program Code ]----------------------------------------------------
PAUSE 3500
Label_00:
  SERIN NMEAin,Baud,1000,Label_00,[WAIT("$HCHDM"),DEC Bearing]
  digit = Bearing // 10
  GOSUB ABCD
  DIRB = digit
  digit = (Bearing // 100) / 10
  GOSUB ABCD
  DIRC = digit
  digit = Bearing / 100
  GOSUB ABCD
  DIRD = digit
  GOTO Label_00
END
'--------------[ Subroutines ]---------------------------------------------
'--------------[ Subroutine ABCD ]-----------------------------------------
'Purpose : Convert decimal digit to ABCD inputs of 7447 display driver.
ABCD:
  LOOKUP digit,[%1111,%1110,%1101,%1100,%1011,%1010,%1001,%1000,%0111,%0110,%0101,%0100,%0011,%0010,%0001,%0000],digit
  RETURN
Sample Code :
'  =========================================================================
'
'   File....... Display3LCD.BS2
'   Purpose.... Driving three 7 segment LCD displays
'               using 7447 display drivers.
'   Author..... O.A.A
'   E-mail..... info@osmanardali.com
'   Started.... Feb 2007
'   Updated....
'
'   {$STAMP BS2}
'   {$PBASIC 2.5}
'
' =========================================================================
' -----[ Program Description ]---------------------------------------------
' -----[ Revision History ]------------------------------------------------
' -----[ I/O Definitions ]-------------------------------------------------
datain            PIN         0    ' "SEROUT" from another BS1/BS2 module
NMEAin            PIN         1    ' NMEA Data
pindp1            PIN         2
pindp2            PIN         3
pin1A             PIN         4
pin1B             PIN         5
pin1C             PIN         6
pin1D             PIN         7
pin2A             PIN         8
pin2B             PIN         9
pin2C             PIN        10
pin2D             PIN        11
pin3A             PIN        12
pin3B             PIN        13
pin3C             PIN        14
pin3D             PIN        15
' -----[ Constants ]-------------------------------------------------------
Baud           CON     16780
' -----[ Variables ]-------------------------------------------------------
Number          VAR         Word
digit           VAR         Byte
' -----[ Initialization ]--------------------------------------------------
DIRB = %1111                    '  ones digit
DIRC = %1111                    '  tens digit
DIRD = %1111                    '  hundreds digit
' Segment test
    DIRD = %0000
    DIRC = %0000
    DIRB = %0111
    PAUSE 100
    DIRD = %0000
    DIRC = %0111
    PAUSE 100
    DIRD = %0000
    PAUSE 100
    DIRB = %1111 : DIRC = %1111 : DIRD = %1111
' -----[ Program Code ]----------------------------------------------------
  Label_00:
    SERIN datain,Baud,[WAIT("!"),Number.BYTE0,Number.BYTE1]
' display "Number" in digits 1 to 3
    digit = Bearing // 10
    GOSUB ABCD
    DIRB = digit
    digit = (Bearing // 100) / 10
    GOSUB ABCD
    DIRC = digit
    digit = Bearing / 100
    GOSUB ABCD
    DIRD = digit
    GOTO Label_00
END
' -----[ Subroutines ]-----------------------------------------------------
' ------[ Subroutine DCBA ]----------------------------------------------
'  Purpose : Convert decimal digit to ABCD inputs of 7447 display driver
ABCD:
  LOOKUP digit,[%1111,%1110,%1101,%1100,%1011,%1010,%1001,%1000,%0111,%0110,%0101,%0100,%0011,%0010,%0001,%0000],digit
  RETURN

backarrow
RETURN

hermes replica, celine tote bags, Replica bags, outlet canada goose, Cheap Canada Goose clothing Canada Goose jacket Canada Goose People darlenemccoy azaadsource.com celine Hot Canada Goose www.cvcargo.net hermes birkin bag celine bags online prada handbags outlet canada goose women celine handbags canada goose kensington parka prada online hermes birkin handbags trong>Canada Goose Outlet