LCD displaying numbers from 0 to 999 in MikrobasicA program used to display numbers f

Discussion in 'Embedded Systems and Microcontrollers' started by Nibiru, Feb 13, 2012.

  1. Nibiru

    Thread Starter New Member

    Oct 11, 2010
    1
    0
    A program used to display numbers from 0 to 999. actually the word 'FLOW RATE =' is first displayed.
    when portc.0=1, a value of 0 to 9 is displayed on the 11th column of row 1.
    when portc.1=1, the cursor moves to the right, that is to the 12th column of row 1
    and if portc.0 is given a value of 1 (5V), a value of 0 to 9 is displayed on the 12th column of row 1, as long as portc.0=1
    sadly, it is not working as planned on the PIC simulator IDE.
    Please help friends


    program LCD_trial12

    dim k0 as byte
    dim text as string [20]

    main:
    TRISC = 1
    TRISB = 0
    Lcd_Init (portB)
    Lcd_Cmd(LCD_CLEAR)

    text = "FLOW RATE="
    Lcd_Out(1,1,text)
    Lcd_Cmd(Lcd_Underline_On)

    k0=0

    path0:
    for k0=0 to 9
    if
    portc.0=1
    then
    gosub augmenter
    end if
    return

    if
    portc.1=1
    then
    Lcd_cmd(Lcd_Move_Cursor_Right)
    end if
    delay_us(1000)
    goto path0


    augmenter:

    select case k0

    case 0
    Lcd_out_cp("0")


    case 1
    Lcd_out_cp("1")


    case 2
    Lcd_out_cp("2")


    case 3
    Lcd_out_cp("3")


    case 4
    Lcd_out_cp("4")


    case 5
    Lcd_out_cp("5")


    case 6
    Lcd_out_cp("6")


    case 7
    Lcd_out_cp("7")


    case 8
    Lcd_out_cp("8")


    case 9
    Lcd_out_cp("9")

    end select
    delay_us(1000)
    next k0

    return

    end.
     
Loading...