adding new word variable ?


Results 1 to 5 of 5

Threaded View

  1. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    INCLUDE "modedefs.bas"
    DEFINE LCD_DREG PORTD 'LCD data port
    DEFINE LCD_DBIT 4 'LCD data starting bit 0 at RD4 to RD7
    DEFINE LCD_RSREG PORTD 'LCD register select port
    DEFINE LCD_RSBIT 2 'LCD register select bit
    DEFINE LCD_EREG PORTD 'LCD enable port
    DEFINE LCD_EBIT 3 'LCD enable bit
    DEFINE LCD_BITS 4 'LCD bus size 4 or 8
    DEFINE LCD_LINES 4 'Number lines on LCD
    DEFINE OSC 4 ' We're using a 4 MHz oscillator
    reg_but var portb.4:fin_but var portb.5:can_but var portb.6 : qobol1 var porta.1 : qobol2 var porta.2 : qobol3 var porta.3 : qobol4 var porta.4:malya1 var porta.5
    malya2 var portb.7:adcon1=7 : din var porte.0:load var porte.1:clk var porte.2:initial var porta.0:trisa=255:trise=0:input initial:id1 var bit[253]:id2 var bit[99]
    id var byte[9]:char var byte:counter1 var byte:counter2 var byte:i var byte : digit var byte:num var byte:address var byte : datareg var byte:number1 var word
    number2 var word:number3 var word:number4 var word:maxnumber var word:load=1:rs232_out var portd.0:rs232_in var portd.1:clock_barcode var portb.0
    data_barcode var portb.1 : pstrobe var portb.2:data_printer var portc : busy var portb.3:clr con 1:line1 con 128:line2 con 192:line3 con 148:line4 con 212
    ins con 254:input clock_barcode:input data_barcode : output portd.1:input reg_but:input fin_but:input can_but:input malya2:input busy : output pstrobe:trisc=0
    pstrobe=1:counter1=0:counter2=0:char=0:i=0
    ;;;;;;;;;;;;;;;; get numbers for eeprom
    read 0,number1:read 1,number2:read 2,number3:read 3,number4:gosub init_max:gosub disp1:gosub disp2:gosub disp3:gosub disp4 : pause 2000 : option_reg=$80
    intcon=$90
    ON INTERRUPT GOTO reg_id
    lcdout Ins , clr , INS , Line1 , "Please Ins. ID card" : goto main
    ;;;;;;; interrupt service routine
    DISABLE ' Disable interrupts in handler
    reg_id:
    intcon.1=0 ;reset int HOW DO YOU KNOW THAT THE PARTICULAR INTERRUPT YOU WANT ACTUALLY FIRED? YOU'RE JUST ASSUMING ONE FIRED OFF, NOT THE ONE YOU WANTED
    if clock_barcode=0 then ; test falling edge
    if counter1<253 then
    id1[counter1]=data_barcode : counter1=counter1+1
    else
    id2[counter2]=data_barcode : counter2=counter2+1
    ;;;;;;; test
    endif
    endif
    RESUME ' Return to main program
    ENABLE ' Enable interrupts after handler
    ;;;;;;;;;;;;;;;;;
    Main:
    ;;; automatic display ID card after interrupt finished
    if counter2>98 then ;;
    serout rs32_out,t9600,["Student registered",13,10]:lcdout ins,clr,ins,line1," CCAST ",ins,line2,"Your ID:":serout rs232_out,t9600,["Your ID:",13,10]
    gosub ID_decode
    ;;;;;;;;;;;;;;;;
    else
    if initial=0 then
    gosub initial_system
    else
    gosub monitor_buttons
    endif
    endif
    goto main ' Remain in loop
    end

    See notes in code above
    Last edited by skimask; - 21st February 2008 at 00:36.

Similar Threads

  1. Minimizing code space
    By Tobias in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th May 2009, 07:25
  2. SEROUT WORD variable problem
    By Tobias in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 19th April 2009, 11:20
  3. DS2760 Thermocouple Kit from Parallax in PicBasicPro
    By seanharmon in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 8th July 2008, 23:19
  4. Help with sound command in 2 programs
    By hyperboarder in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 5th July 2007, 20:36
  5. calculation problem
    By nicolelawsc in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 31st March 2006, 15:23

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts