I'm not smart enough to figure out why this is happening but the problem has been identified. Whenever the program sends "Threebars," it goes wacky. If I modify the code from this:
to this:Code:SELECT CASE BARtemp CASE IS > BARloop LCDOUT ThreeBARS ; send 3 bars ||| CASE IS < BARloop
it will run fine. Of course only two bars will be displayed but something with the code is causing a problem in the display.Code:SELECT CASE BARtemp CASE IS > BARloop CASE IS < BARloop
I made a bargraph routine and it works just fine so the problem is a conflict between the lcdbar inlcude file and the OLED screen. There isn't enough experience in my brain to figure out why so maybe someone else can. It was a good experience for me because I never used bargraphs before and I learned a lot from DT's program. The only thing I don't like about the program below is that it keeps writing over the previous graph, even if the data doesn't change, so if the bargraph stays at 100% or a high amount, you can see the bargraph flicker a little bit. I'm guessing that a routine is needed whereby nothing is written unless the number changes.
Code:C0 VAR BYTE C1 VAR BYTE C2 VAR BYTE C3 VAR BYTE C4 VAR BYTE C5 VAR BYTE C6 VAR BYTE C7 VAR BYTE C0 = $40 C1 = $48 C2 = $50 C3 = $58 C4 = $60 C5 = $68 C6 = $70 C7 = $78 lcdout 254,C0,REP 16\8 lcdout 254,C1,REP 24\8 lcdout 254,C2,REP 28\8 lcdout 254,C3,REP 30\8 lcdout 254,C4,REP 31\8 BOX VAR WORD LINE VAR WORD FRICT_PAD_TQ_BAR VAR WORD LINE_DISPLAY VAR BYTE BOX_DISPLAY VAR BYTE FRICT_PAD_TQ VAR WORD MAIN: FRICT_PAD_TQ_BAR=(FRICT_PAD_TQ-12)/5 BOX_DISPLAY=127 LINE_DISPLAY=0 FOR LINE = 0 TO FRICT_PAD_TQ_BAR LCDOUT $FE, BOX_DISPLAY,LINE_DISPLAY LINE_DISPLAY=LINE_DISPLAY+1 IF LINE_DISPLAY=5 THEN BOX_DISPLAY=BOX_DISPLAY+1 LINE_DISPLAY=0 ENDIF LCDOUT $FE,212, DEC FRICT_PAD_TQ_BAR NEXT LINE BOX_DISPLAY=0 LINE_DISPLAY=0 GOTO MAIN
Bookmarks