Version=6.80 NumberOfForms=1 Form1=Form1 FormWidth=838 FormHeight=588 IconFile= NumberOfDesktopIncludes=4 DesktopInclude1=Serial2.dll DesktopInclude2=Bitwise.dll DesktopInclude3=ImageLib.dll DesktopInclude4=BinaryFile.dll NumberOfDeviceIncludes=4 DeviceInclude1=Serial2.dll DeviceInclude2=Bitwise.dll DeviceInclude3=ImageLib.dll DeviceInclude4=BinaryFile.dll NumberOfObjects=5 Object1=bit:Bitwise Object2=serial:Serial Object3=bm:Bitmap Object4=bn:Bitmap Object5=bin:BinaryFile NumberOfModules=0 Sub designer addform(Form1,"GLCD","",211,211,211)@ addlabel(form1,Label9,265,420,40,20,"< - - >",211,211,211,0,0,0,True,True,9,False)@ addbutton(form1,Button4,305,420,135,23,"Read value to display",212,208,200,0,0,0,True,True,9)@ addbutton(form1,setitm,590,75,75,23,"Set Itm",212,208,200,0,0,0,True,True,9)@ addbutton(form1,seteeprom,745,10,75,23,"Set Ep",212,208,200,0,0,0,True,True,9)@ addbutton(form1,cgnum,665,40,75,23,"Show item",212,208,200,0,0,0,True,True,9)@ addcombo(form1,cgat,595,40,60,22,"",255,255,255,0,0,0,True,True,8,"1","2","3","4","5","6","7","8",9)@ addcheckbox(form1,cg70,560,165,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg71,545,165,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg72,530,165,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg73,515,165,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg74,500,165,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addbutton(form1,loadcg,665,10,75,23,"Load CG",212,208,200,0,0,0,True,True,9)@ addbutton(form1,savecg,585,10,75,23,"Save CG",212,208,200,0,0,0,True,True,9)@ addsavedialog(form1,SaveDialog2,135,540,All Files|*.cg)@ addopendialog(form1,OpenDialog2,105,540,All Files|*.cg)@ addcheckbox(form1,cg40,560,105,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg41,545,105,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg42,530,105,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg43,515,105,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg44,500,105,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg60,560,145,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg61,545,145,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg62,530,145,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg63,515,145,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg64,500,145,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg50,560,125,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg51,545,125,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg52,530,125,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg53,515,125,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg54,500,125,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg30,560,85,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg31,545,85,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg32,530,85,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg33,515,85,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg34,500,85,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg20,560,65,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg21,545,65,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg22,530,65,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg23,515,65,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg24,500,65,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg10,560,45,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg11,545,45,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg12,530,45,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg13,515,45,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg14,500,45,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg00,560,25,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg01,545,25,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg02,530,25,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg03,515,25,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcheckbox(form1,cg04,500,25,20,20,"",211,211,211,0,0,0,True,True,False,9)@ addcombo(form1,num2,285,145,60,22,"",255,255,255,0,0,0,True,True,4,"1","2","3","4",9)@ addcombo(form1,num1,285,125,60,22,"",255,255,255,0,0,0,True,True,20,"1","2","3","4","5","6","7","8","9","10","11","12","13","14","15","16","17","18","19","20",9)@ addlabel(form1,Label8,350,145,20,20,"Y",211,211,211,0,0,0,True,True,9,False)@ addlabel(form1,Label7,350,125,20,20,"X",211,211,211,0,0,0,True,True,9,False)@ addbutton(form1,att,370,135,65,22,"Set Curs",212,208,200,0,0,0,True,True,9)@ addbutton(form1,sendD,380,90,45,22,"Send",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,TextBox2,285,90,95,22,"Baz",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,l4,390,65,35,23,"L4",212,208,200,0,0,0,True,True,9)@ addbutton(form1,l3,355,65,35,23,"L3",212,208,200,0,0,0,True,True,9)@ addbutton(form1,l2,320,65,35,23,"L2",212,208,200,0,0,0,True,True,9)@ addbutton(form1,l1,285,65,35,23,"L1",212,208,200,0,0,0,True,True,9)@ addbutton(form1,rd,390,40,35,23,"DR",212,208,200,0,0,0,True,True,9)@ addbutton(form1,rc,320,40,35,23,"CR",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button8,300,345,135,20,"Reset",212,208,200,0,0,0,True,True,9)@ addbutton(form1,readimage2,170,285,110,23,"Read Image",212,208,200,0,0,0,True,True,9)@ addlabel(form1,Label6,180,245,75,25,"",211,211,211,0,0,0,True,True,9,False)@ addbutton(form1,Button5,35,470,130,23,"clear image2",212,208,200,0,0,0,True,True,9)@ addlabel(form1,Label5,190,400,40,20,"0 4 8",211,211,211,0,0,0,True,True,9,False)@ addtextbox(form1,TextBox4,235,420,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,TextBox3,190,420,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,showimagedat,170,375,110,23,"Show image data",212,208,200,0,0,0,True,True,9)@ addbutton(form1,loadimagedat,170,345,110,23,"Load image data",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Saveimagedat,170,315,110,23,"Save Image data",212,208,200,0,0,0,True,True,9)@ addimage(form1,Image2,35,395,128,64,"cCenterImage","",245,245,220,True,True)@ addsavedialog(form1,SaveDialog1,15,540,All Files|*.*)@ addopendialog(form1,OpenDialog1,40,540,All Files|*.*)@ addbutton(form1,Loadimage,35,285,130,23,"Load new image",212,208,200,0,0,0,True,True,9)@ addbutton(form1,putoneeprom,180,445,95,23,"Put on Eeprom",212,208,200,0,0,0,True,True,9)@ addimage(form1,Image1,35,315,128,64,"cCenterImage","",245,245,220,True,True)@ addbutton(form1,off,390,10,35,23,"Off",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,byte5,140,85,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,ld,355,40,35,23,"DL",212,208,200,0,0,0,True,True,9)@ addbutton(form1,on,350,10,40,23,"On",212,208,200,0,0,0,True,True,9)@ addbutton(form1,lc,285,40,35,23,"CL",212,208,200,0,0,0,True,True,9)@ addbutton(form1,clear,285,10,70,23,"Clear",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button3,300,315,135,20,"Clr LCD graphics",212,208,200,0,0,0,True,True,9)@ addbutton(form1,Button2,300,285,135,20,"Clr LCD text",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,byte4,105,85,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,byte3,75,85,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addtextbox(form1,byte2,45,85,30,22,"0",255,255,255,0,0,0,True,True,False,9)@ addlabel(form1,Label4,110,65,20,20,"D",211,211,211,0,0,0,True,True,9,False)@ addlabel(form1,Label3,85,65,20,20,"Y",211,211,211,0,0,0,True,True,9,False)@ addlabel(form1,Label2,55,65,20,20,"X",211,211,211,0,0,0,True,True,9,False)@ addlabel(form1,Label1,20,65,20,20,"C",211,211,211,0,0,0,True,True,9,False)@ addtextbox(form1,byte1,15,85,30,22,"D",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,Button1,175,85,45,20,"Send",212,208,200,0,0,0,True,True,9)@ addtextbox(form1,TextBox1,10,35,220,22,"",255,255,255,0,0,0,True,True,False,9)@ addbutton(form1,xit,170,10,60,23,"Exit",212,208,200,0,0,0,True,True,7)@ addbutton(form1,close,90,10,60,23,"Close port",212,208,200,0,0,0,True,True,7)@ addbutton(form1,open,10,10,60,23,"Open port",212,208,200,0,0,0,True,True,7)@ End Sub @EndOfDesignText@ Sub Globals bite1=0 bite2=0 bite3=0 bite4=0 bite5=0 Dim byt(1) As byte Dim ray(64,16) mby=0 Dim th(8192) As byte Dim cg(64) As byte Dim cg1(8,8) zx=0 zy=0 loaded=False End Sub Sub App_Start Form1.show num1.SelectedIndex=0 num2.SelectedIndex=0 cgat.SelectedIndex=0 Sip=False serial.New2(40,9600,"N",8,1) bn.New1(AppPath & "\white.bmp") bit.New1 image2.Image=bn.Value End Sub Sub open_Click ErrorLabel(err1) serial.PortOpen=True textbox1.Text="port open." & CRLF form1.Refresh Sleep(250) textbox1.Text=textbox1.Text & serial.InputString Return err1: textbox1.Text="Port failed to open" End Sub Sub close_Click serial.PortOpen=False textbox1.Text="Port closed" End Sub Sub xit_Click ErrorLabel(err2) serial.PortOpen=False serial.Dispose err2: AppClose End Sub Sub coords(s) x1=s t1=Int(x1/8) t2=8*t1 t3=x1-t2 If t3<1 Then t3=Int(t3*10) t3=t3+1 t3=8-t3 bite2=t1 bite4=t3 End Sub Sub Button1_Click bite1=byte1.Text bite2=byte2.Text bite3=byte3.Text bite4=byte4.Text If bite1 = "D" Then coords(bite2) End If serial.Output(bite1) byt(0)=bite2 serial.Output2(byt()) byt(0)=bite3 serial.Output2(byt()) byt(0)=bite4 serial.Output2(byt()) End Sub Sub Button2_Click serial.Output("C") serial.Output(" ") serial.Output(" ") serial.Output(" ") 'serial.Output(" ") End Sub Sub Button3_Click serial.Output("G") serial.Output(" ") serial.Output(" ") serial.Output(" ") 'serial.Output(" ") End Sub Sub dot(a,b) byte1.Text="D" byte2.Text=a byte3.Text=b byte4.Text=0 'byte5.Text=0 Button1_Click End Sub Sub readimage2_Click zx=0 mby=0 For y = 0 To 63 For x = 0 To 15 For z = 0 To 7 s=(bm.GetPixel1(((x*8) + z),y)) +1 If s<>0 Then th(zx)=1 mby=bit.SetBit(mby,7-z) Else th(zx)=0 End If zx=zx+1 Next z ray(y,x)=mby mby=0 Next x Next y writeimage2 End Sub Sub writeimage2 zx=0 For y = 0 To 63 For x = 0 To 15 For z = 0 To 7 If th(zx) =1 Then bn.SetPixel(((x*8) + z),y,cBlack) Else bn.SetPixel(((x*8) + z),y,cWhite) End If zx=zx+1 Next z Next x image2.Image=bn.Value DoEvents Next y End Sub Sub putoneeprom_Click ad1=textbox4.Text ad2=textbox3.Text For y = 0 To 63 For x = 0 To 15 serial.Output("P") byt(0)=ad2 serial.Output2(byt()) byt(0)=ad1 serial.Output2(byt()) byt(0)=ray(y,x) serial.Output2(byt()) ad1=ad1+1 If ad1=256 Then ad2=ad2+1 ad1=0 End If Sleep(100) Next Next End Sub Sub showimagedat_Click 'show image data on image2 writeimage2 End Sub Sub Loadimage_Click 'open image If opendialog1.Show = cCancel Then Return bm.New1(opendialog1.File) image1.Image=bm.Value End Sub Sub Saveimagedat_Click 'save data If savedialog1.Show = cCancel Then Return name=savedialog1.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.WriteBytes(th()) FileClose(c1) End Sub Sub loadimagedat_Click 'read data If opendialog1.Show = cCancel Then Return name = opendialog1.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.ReadBytes(th(),8192) FileClose(c1) End Sub Sub Button5_Click bn.New1(AppPath & "\white.bmp") image2.Image=bn.Value End Sub Sub Button6_Click zx=0 For y = 0 To 63 For x = 0 To 127 If th(zx)=1 Then serial.Output("D") coords(x) byt(0)=bite2 serial.Output2(byt()) byt(0)=y serial.Output2(byt()) byt(0)=bite4 serial.Output2(byt()) End If zx=zx+1 DoEvents Next Next End Sub Sub Button8_Click serial.Output("X") serial.Output(" ") serial.Output(" ") serial.Output(" ") End Sub Sub clear_Click serial.Output("B") serial.Output(" ") serial.Output(" ") serial.Output(" ") End Sub Sub on_Click serial.Output("F") serial.Output(Chr(15)) serial.Output(" ") serial.Output(" ") End Sub Sub off_Click serial.Output("F") serial.Output(Chr(8)) serial.Output(" ") serial.Output(" ") End Sub Sub lc_Click serial.Output("F") serial.Output(Chr(16)) serial.Output(" ") serial.Output(" ") End Sub Sub ld_Click serial.Output("F") serial.Output(Chr(24)) serial.Output(" ") serial.Output(" ") End Sub Sub rc_Click serial.Output("F") serial.Output(Chr(20)) serial.Output(" ") serial.Output(" ") End Sub Sub rd_Click serial.Output("F") serial.Output(Chr(28)) serial.Output(" ") serial.Output(" ") End Sub Sub at(x,y) If y = 0 Then a=128+x If y = 1 Then a=168+x If y = 2 Then a=148+x If y = 3 Then a=212+x serial.Output("F") byt(0)=a serial.Output2(byt()) serial.Output(" ") serial.Output(" ") End Sub Sub att_Click at(num1.SelectedIndex,num2.SelectedIndex) End Sub Sub l1_Click linex(128) End Sub Sub l2_Click linex(168) End Sub Sub l3_Click linex(148) End Sub Sub l4_Click linex(212) End Sub Sub linex(l) serial.Output("F") byt(0)=l serial.Output2(byt()) serial.Output(" ") serial.Output(" ") End Sub Sub sendD_Click For a= 0 To (StrLength(textbox2.Text)-1) serial.Output("M") serial.Output(StrAt(textbox2.Text,a)) serial.Output(" ") serial.Output(" ") Sleep(200) Next a End Sub Sub savecg_Click zx=0 For a = 0 To 7 For b = 0 To 7 cg(zx)=cg1(a,b) zx=zx+1 Next Next If savedialog2.Show = cCancel Then Return name=savedialog2.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.WriteBytes(cg()) FileClose(c1) End Sub Sub loadcg_Click If opendialog2.Show = cCancel Then Return name = opendialog2.File FileOpen(c1,name,cRandom) bin.New1(c1,True) bin.ReadBytes(cg(),64) FileClose(c1) zx=0 For a = 0 To 7 For b = 0 To 7 cg1(a,b)=cg(zx) zx=zx+1 Next Next loaded=True End Sub Sub setcg temp=0 isit=False For y = 0 To 7 For x = 0 To 4 isit = Control("cg" & y & x,combobox).Checked If isit = True Then temp=bit.SetBit(temp,x) End If Next cg1(cgat.SelectedIndex,y)=temp temp=0 Next End Sub Sub setitm_Click setcg End Sub Sub showcg temp2=0 For y = 0 To 7 For x = 0 To 4 temp=cg1(cgat.SelectedIndex,y) temp2=bit.GetBit(temp,x) If temp2 = True Then Control("cg" & y & x,combobox).Checked=True Else Control("cg" & y & x,combobox).Checked=False End If Next Next End Sub Sub cgnum_Click If loaded=False Then Msgbox("File not loaded","Oops") Return Else showcg End If End Sub Sub seteeprom_Click serial.Output("F") serial.Output(Chr(64)) serial.Output(" ") serial.Output(" ") Sleep(100) For a = 0 To 7 For b = 0 To 7 serial.Output("M") serial.Output(Chr(cg1(a,b))) serial.Output(" ") serial.Output(" ") Sleep(150) Next Next serial.Output("F") serial.Output(Chr(0)) serial.Output(" ") serial.Output(" ") End Sub Sub Button4_Click serial.Output("V") byt(0)=textbox3.Text serial.Output2(byt()) byt(0)=textbox4.Text serial.Output2(byt()) byt(0)=0 serial.Output2(byt()) End Sub