Hi, sorry this question is related to previous post #27...I need to to send a character "c"(dec 99) constantly to the pc in the main loop(loop1). Then send 1(dec 49) if any coin pulse is detected.
Code:
' Main Program LoopLoop1:
'Lcdout $fe, 128, "Counter: ", #i 
USBService ' Must service USB regularly
'**************ADDED COde
 Buffer2[0] = 99  
 Buffer2[1] =13  
 TMR0L = 0     
 USBOut 3, Buffer2, cnt,Loop1
 goto Loop1
'****************************
TMR0L = 0     ' Clear TMR0 count before start

Loop2:
    USBService
    WHILE TMR0L = 0 ' Wait for high-to-low transition 
    USBService       
    WEND           ' on RA4/T0CKI
    pause 5
    PORTB.0 = 1    ' LED on to indicate transition seen 
    i=i+1       ' Clear screen
    USBService
    buffer[0] = 49
    Buffer[1] = 13       
    USBOut 3, Buffer, cnt,Loop2
    'Lcdout $fe, 128, "Counter: ", #i   
    'PAUSE 30
    PORTB.0 = 0    ' LED off
    goto Loop1
When I run the program..it displays "c" to the pc but never detect pulse when coin is dropped. Can you help me out what I'm doing wrong?

thanks,
tacbanon