久久久久久久999_99精品久久精品一区二区爱城_成人欧美一区二区三区在线播放_国产精品日本一区二区不卡视频_国产午夜视频_欧美精品在线观看免费

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 3249|回復(fù): 0
收起左側(cè)

BASCOM版 HDG12864F-1液晶屏演示

[復(fù)制鏈接]
ID:342822 發(fā)表于 2020-11-28 22:33 | 顯示全部樓層 |閱讀模式
3699ph.gif

演示程序:
rem Main.bas file generated by New Project wizard
rem
rem Created:   周五 11月 27 2020
rem Processor: ATmega8
rem Compiler:  BASCOM-AVR

rem Write your code here

'-----------------------------------------------------------
'                     EADOGM128.BAS
'               (c) 1995-2020 MCS Electronics
' micro : mega168
' demo  : SPI graphical display EADOGM128
' IMPORTANT : SPI only allows the WRITE mode. THis mean that setting pixels is not possible.
'             for this reason commands as PSET, LINE and CIRCLE are not supported.
'             best option would be to display pictures
' fonts and images are compatible to KS108
'-----------------------------------------------------------
$regfile = "m8def.dat"                                    ' ATmega8
$crystal = 8000000
$baud = 19200
$lib "glcdeadogm128x6.lbx"                                  ' specify the used lib
$hwstack = 40
$swstack = 40
$framesize = 40



'the display was connected with these pins
Config Graphlcd = 128x64eadogm , Cs1 = Portd.4 , A0 = Portd.7 , Si = Portb.3 , Sclk = Portb.5 , Rst = Portd.5
'the best option is to control the reset line of the LCD with the micro so you can reset it controlled at startup

Config Adc = Single , Prescaler = Auto , Reference = Avcc

Dim B As Byte , J As Byte
Dim K As Byte , X As Word , Y As Word

Print "cls"
Cls

'specify the font we want to use
Setfont Font8x8tt


'You can use locate but the columns have a range from 1-128
'When you want to show somthing on the LCD, use the LDAT command
'LCDAT Y , COL, value
Lcdat 1 , 1 , "111ABCDE"
Lcdat 2 , 1 , "88888888"
Lcdat 3 , 1 , "MCS Electronics" , 1
Waitms 3000

Dim I As Word
For I = 110 To 113
  Lcdat 1 , 1 , I
  Waitms 500
  Cls 1 , 1 , 24 , 255                                      'clear inverse
  Waitms 500
Next

Waitms 3000


Setfont Font12x16
Cls
Lcdat 4 , 1 , "HDG12864F-1"                                   'a bigger font
Wait 2
CLS
Lcdat 1, 32 ,chr(146); chr(147); chr(148); chr(149); chr(150),1
Wait 2
Lcdat 3, 32, chr(151); chr(152); chr(153); chr(154); chr(155),1
Wait 2
Lcdat 5 , 32, chr(156); chr(157); chr(158);chr(159); chr(160),1
Wait 2
Lcdat 7 , 32, chr(161); chr(162); chr(163); chr(164); chr(165),1
Wait 5

cls
'Setfont Font8x8tt

Showpic 0 , 0 , Plaatje
Waitms 3000
Do
' Gosub Touch                                               'optional touch screen
Loop

End

'portc.0-portc.3 pin 1-4
Touch:                    '幫幫忙這一段不知如何仿真
   Start Adc
   Waitms 200
   Config Portc.0 = Output                                  'Bottom
   Config Portc.2 = Output                                  'Top
   Set Portc.0                                              'High
   Reset Portc.2                                            'Low
   Config Pinc.1 = Input                                    'left as input
   Config Pinc.3 = Input                                    'right as input
   Waitms 80
   Y = Getadc(3)
  Y = Y - 365
print y
   If Y > 640 Then Y = 0
   Config Portc.1 = Output                                  'Left
   Config Portc.3 = Output                                  'Right
   Set Portc.3
   Reset Portc.1
   Config Pinc.0 = Input
   Config Pinc.2 = Input
   Waitms 80
   X = Getadc(0)

   X = X - 196
print x
   If X > 800 Then X = 0
   Lcdat 1 , 1 , "X : " ; X
   Lcdat 1 , 74 , "Y : " ; Y
Return
Plaatje:
'include the picture data
$bgf "../mty1.BGF"

'include used fonts
$include "../font8x8TT.font"
$include "../Font12x16.font"

評分

參與人數(shù) 1黑幣 +50 收起 理由
admin + 50 共享資料的黑幣獎勵!

查看全部評分

回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機教程網(wǎng)

快速回復(fù) 返回頂部 返回列表
主站蜘蛛池模板: 九九久久国产精品 | 精品久久久久久 | 欧美亚洲日本 | av免费网址| 国产高清免费 | 久久久综合精品 | 国产91视频免费 | 天堂一区二区三区 | 操人视频在线观看 | 久久国色| 日日夜夜91| 99热在线免费 | 色综网| 波多野结衣一区二区 | 午夜一级做a爰片久久毛片 精品综合 | 美日韩精品 | 国产激情视频网站 | 色香婷婷 | 一级全黄少妇性色生活免费看 | 亚洲精品国产成人 | 日韩一区二区福利视频 | 成人欧美一区二区三区在线观看 | 人人干天天干 | 色婷婷av久久久久久久 | 国产精品色 | 中文久久| 91在线精品一区二区 | 欧美日韩一区在线 | 色视频成人在线观看免 | 国产综合一区二区 | 欧美精品福利 | 日韩亚洲一区二区 | 亚洲一区二区视频 | 欧美日本在线观看 | 日韩伦理一区二区三区 | 91久久精品国产91久久 | 亚洲精品视频网站在线观看 | 综合久 | 成人二区三区 | www成人免费视频 | 色秀网站|