; PicBasic Pro Compiler 2.45, (c) 1998, 2004 microEngineering Labs, Inc. All Rights Reserved. PM_USED EQU 1 INCLUDE "16F84A.INC" ; Define statements. #define LCD_DREG PORTB #define LCD_DBIT 0 #define LCD_RSREG PORTB #define LCD_RSBIT 4 #define LCD_EREG PORTB #define LCD_EBIT 6 #define LCD_BITS 4 #define LCD_LINES 2 #define LCD_RWREG PORTB #define LCD_RWBIT 5 #define OSC 4 RAM_START EQU 0000Ch RAM_END EQU 0004Fh RAM_BANKS EQU 00001h BANK0_START EQU 0000Ch BANK0_END EQU 0004Fh EEPROM_START EQU 02100h EEPROM_END EQU 0213Fh R0 EQU RAM_START + 000h R1 EQU RAM_START + 002h R2 EQU RAM_START + 004h R3 EQU RAM_START + 006h R4 EQU RAM_START + 008h R5 EQU RAM_START + 00Ah R6 EQU RAM_START + 00Ch R7 EQU RAM_START + 00Eh R8 EQU RAM_START + 010h T1 EQU RAM_START + 012h FLAGS EQU RAM_START + 014h GOP EQU RAM_START + 015h RM1 EQU RAM_START + 016h RM2 EQU RAM_START + 017h RR1 EQU RAM_START + 018h RR2 EQU RAM_START + 019h _calib EQU RAM_START + 01Ah _final EQU RAM_START + 01Ch _minuscal EQU RAM_START + 01Eh _pluscal EQU RAM_START + 020h _x1gee EQU RAM_START + 022h _xavg EQU RAM_START + 024h _xaxis EQU RAM_START + 026h _xconst EQU RAM_START + 028h _xfinal EQU RAM_START + 02Ah _xinput EQU RAM_START + 02Ch _xsmooth EQU RAM_START + 02Eh _y1gee EQU RAM_START + 030h _yavg EQU RAM_START + 032h _yaxis EQU RAM_START + 034h _yconst EQU RAM_START + 036h _yfinal EQU RAM_START + 038h _yinput EQU RAM_START + 03Ah _ysmooth EQU RAM_START + 03Ch _signs EQU RAM_START + 03Eh _x EQU RAM_START + 03Fh _xchar EQU RAM_START + 040h _xneg EQU RAM_START + 041h _ychar EQU RAM_START + 042h _yneg EQU RAM_START + 043h _PORTL EQU PORTB _PORTH EQU PORTA _TRISL EQU TRISB _TRISH EQU TRISA #define _PORTA_3 PORTA, 003h #define _PORTA_0 PORTA, 000h #define _PORTA_1 PORTA, 001h INCLUDE "FINAL_~2.MAC" INCLUDE "PBPPIC14.LIB" LABEL?L _splash LCDOUT?C 0FEh LCDOUT?C 001h LCDOUT?C 020h LCDOUT?C 020h LCDOUT?C 020h LCDOUT?C 047h LCDOUT?C 02Dh LCDOUT?C 066h LCDOUT?C 06Fh LCDOUT?C 072h LCDOUT?C 063h LCDOUT?C 065h LCDOUT?C 020h LCDOUT?C 04Dh LCDOUT?C 065h LCDOUT?C 074h LCDOUT?C 065h LCDOUT?C 072h LCDOUT?C 020h LCDOUT?C 020h LCDOUT?C 020h LCDOUT?C 0FEh LCDOUT?C 0C0h LCDOUT?C 020h LCDOUT?C 04Ah LCDOUT?C 065h LCDOUT?C 068h LCDOUT?C 061h LCDOUT?C 064h LCDOUT?C 020h LCDOUT?C 054h LCDOUT?C 061h LCDOUT?C 062h LCDOUT?C 061h LCDOUT?C 073h LCDOUT?C 068h LCDOUT?C 020h LCDOUT?C 028h LCDOUT?C 04Eh LCDOUT?C 045h LCDOUT?C 055h LCDOUT?C 029h LCDOUT?C 020h PAUSE?C 003E8h LABEL?L _loop CMPT?TL _PORTA_3, L00001 GOSUB?L _splash LABEL?L L00001 MOVE?CW 000h, _xsmooth MOVE?CW 000h, _ysmooth MOVE?CB 001h, _x LABEL?L L00003 CMPGT?BCL _x, 004h, L00004 PULSIN?TCW _PORTA_0, 001h, _xinput PULSIN?TCW _PORTA_1, 001h, _yinput ADD?WWW _xsmooth, _xinput, _xsmooth ADD?WWW _ysmooth, _yinput, _ysmooth NEXT?BCL _x, 001h, L00003 LABEL?L L00004 DIV?WCW _xsmooth, 004h, _xsmooth DIV?WCW _ysmooth, 004h, _ysmooth MOVE?WW _xsmooth, _xfinal MOVE?WW _ysmooth, _yfinal LCDOUT?C 0FEh LCDOUT?C 001h LCDOUT?C 058h LCDOUT?C 020h LCDOUT?C 03Dh LCDOUT?C 020h MOVE?WW _xfinal, _final GOSUB?L _paintlcd LCDOUT?C 0FEh LCDOUT?C 0C0h LCDOUT?C 059h LCDOUT?C 020h LCDOUT?C 03Dh LCDOUT?C 020h MOVE?WW _yfinal, _final GOSUB?L _paintlcd GOTO?L _loop END? LABEL?L _paintlcd LCDOUTCOUNT?C 001h DIV?WCW _final, 064h, T1 LCDOUTNUM?W T1 LCDOUTDEC? LCDOUT?C 02Eh LCDOUTCOUNT?C 002h LCDOUTNUM?W _final LCDOUTDEC? RETURN? END