Files
SyncHome/trunk/workspace/gcb/glcd.gcb
2023-03-09 12:51:54 +00:00

46 lines
1.4 KiB
Plaintext

' ########### start ###########
' pic:PIC16F886
' ########### end ###########
;Chip Settings
#chip 16F886,16
'#config MCLRE = on 'enable reset switch on CHIPINO
#include <chipino.h>
#include <GLCD.h>
;Defines (Constants)
#define GLCD_RW PORTB.1 'D9 to pin 5 of LCD
#define GLCD_RESET PORTB.5 'D13 to pin 17 of LCD
#define GLCD_CS1 PORTB.3 'D12 to actually since CS1, CS2 are backward
#define GLCD_CS2 PORTB.4 'D11 to actually since CS1, CS2 are backward
#define GLCD_RS PORTB.0 'D8 to pin 4 D/I pin on LCD
#define GLCD_ENABLE PORTB.2 'D10 to Pin 6 on LCD
#define GLCD_DB0 PORTC.7 'D0 to pin 7 on LCD
#define GLCD_DB1 PORTC.6 'D1 to pin 8 on LCD
#define GLCD_DB2 PORTC.5 'D2 to pin 9 on LCD
#define GLCD_DB3 PORTC.4 'D3 to pin 10 on LCD
#define GLCD_DB4 PORTC.3 'D4 to pin 11 on LCD
#define GLCD_DB5 PORTC.2 'D5 to pin 12 on LCD
#define GLCD_DB6 PORTC.1 'D6 to pin 13 on LCD
#define GLCD_DB7 PORTC.0 'D7 to pin 14 on LCD
InitGLCD
Start:
GLCDCLS
GLCDPrint 0,10,"Hello" 'Print Hello
wait 5 s
GLCDPrint 0,10, "ASCII #:" 'Print ASCII #:
Box 18,30,28,40 'Draw Box Around ASCII Character
for char = 15 to 129 'Print 0 through 9
GLCDPrint 17, 20 , Str(char)
GLCDdrawCHAR 20,30, char
wait 1 s
next
line 0,50,127,50 'Draw Line using line command
for xvar = 0 to 80 'draw line using Pset command
pset xvar,63,on '
next '
Wait 10 s
Goto Start