Using div32 to get decimal numbers


Results 1 to 8 of 8

Threaded View

  1. #4
    Join Date
    Apr 2010
    Posts
    6


    Did you find this post helpful? Yes | No

    Default Using div32 to get decimal numbers

    I have written the code as follows below,but the output is so fast,I think its giving me millilitres rather than litres...How do I modify it





    W VAR BYTE
    W1 var WORD
    W2 VAR WORD
    W3 VAR WORD
    DEFINE LCD_DREG PORTD
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTD
    DEFINE LCD_RSBIT 1
    DEFINE LCD_EREG PORTD
    DEFINE LCD_EBIT 2
    DEFINE LCD_BITS 4
    DEFINE LCD_LINES 2
    DEFINE LCD_COMMANDUS 2000
    DEFINE LCD_DATAUS 50
    W=0
    W1=0
    W3=0
    PAUSE 1000
    MAIN:
    IF PORTC.2=1 THEN
    W=1
    FOR W = 0 TO 65
    NEXT W
    W1= W1 + (W/65)
    W2= ((W1 // 65) *10000)/65
    W3= DIV32 100
    LCDOUT 254,1
    LCDOUT DEC W1, ".", DEC W3, "L"
    ENDIF
    GOTO MAIN
    Last edited by nkwankwe; - 19th April 2010 at 03:47.

Members who have read this thread : 0

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

Tags for this Thread

Posting Permissions

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