st7735的Proteus仿真测试
单片机源程序如下:
'----------------------------------------------------------------------------'
' ST7735R display library '
' resolution 128x160 '
' '
' BASCOM-AVR 2.0.8.0. '
' Shilov Sergey ?017 '
' St-Peterburg '
' RUSSIA '
' '
'----------------------------------------------------------------------------'
$regfile = "m8adef.dat"
$crystal = 8000000
$hwstack = 64
$swstack = 64
$framesize = 64
'------------------------------- Setup -----------------------------------------
$lib "glcd-ST7735R_april.lib"
'$lib "glcd-ST7735R_march.lib"
Config Graphlcd = Color , A0 = Portd.3 , Si = Portd.2 , Sclk = Portd.1 , Cs1 = Portd.4 , Rst = Portd.0 ' CS1 & Rst are optional
Const Portrait = 0 '1=Portrait, 0=Landscape
Const Rotate_180 = 0 '1=Rotated, 0=Not Rotated
'------------------- Variables & Constants -------------------------------------
Const Blue = &B00000011 ''predefined contants are making programming easier
Const Yellow = &B11111100
Const Red = &B11100000
Const Green = &B00011100
Const Black = &B00000000
Const White = &B11111111
Const Brightgreen = &B00111110
Const Darkgreen = &B00010100
Const Darkred = &B10100000
Const Darkblue = &B00000010
Const Brightblue = &B00011111
Const Orange = &B11111000
Const Violet = &B11100011
Dim I As Byte , N As Byte , M As Byte , P As Byte
'============================ Main prog ========================================
Initlcd
Cls
Do
#if Portrait = 0
Boxfill(0 , 0) -(159 , 127) , Green
Boxfill(0 , 0) -(159 , 127) , Red
Boxfill(0 , 0) -(159 , 127) , Violet
Boxfill(0 , 0) -(159 , 127) , Yellow
Boxfill(0 , 0) -(159 , 127) , Blue
Line(0 , 0) -(159 , 0) , Yellow
Line(0 , 0) -(0 , 127) , Yellow
Line(0 , 127) -(159 , 127) , Yellow
Line(159 , 0) -(159 , 127) , Yellow
Pset 1 , 1 , Yellow
Pset 158 , 1 , Yellow
Pset 1 , 126 , Yellow
Pset 158 , 126 , Yellow
Box(2 , 2) -(157 , 125) , Yellow
For I = 1 To 63 Step 4
Circle(80 , 64) , I , Green
Next I
Setfont Color8x8
Lcdat 60 , 20 , "Display ST7735R" , Orange , Blue
Wait 1
Boxfill(0 , 0) -(159 , 127) , White
Showpic 40 , 24 , Clock
#else
Boxfill(0 , 0) -(127 , 159) , Green
Boxfill(0 , 0) -(127 , 159) , Red
Boxfill(0 , 0) -(127 , 159) , Violet
Boxfill(0 , 0) -(127 , 159) , Yellow
Boxfill(0 , 0) -(127 , 159) , Blue
Line(0 , 0) -(127 , 0) , Yellow
Line(0 , 0) -(0 , 159) , Yellow
Line(0 , 159) -(127 , 159) , Yellow
Line(127 , 0) -(127 , 159) , Yellow
Pset 1 , 1 , Yellow
Pset 126 , 1 , Yellow
Pset 1 , 158 , Yellow
Pset 126 , 158 , Yellow
Box(2 , 2) -(125 , 157) , Yellow
For I = 1 To 63 Step 4
Circle(64 , 80) , I , Green
Next I
Setfont Color8x8
Lcdat 76 , 20 , " ST7735R " , Orange , Blue
Wait 1
Boxfill(0 , 0) -(127 , 159) , White
Showpic 24 , 40 , Clock
#endif
Wait 2
Loop
End
'-------------------------------------------------------------------------------
$include "color8x8.font"
Clock:
$bgf "Clock.bgc"
上一篇:nrf24l01无线芯片的开发板范例-AVR(已验证通过)
下一篇:ATMEGA16单片机实现的数控频率计原理图及程序
推荐阅读最新更新时间:2024-11-10 01:34
设计资源 培训 开发板 精华推荐
- NV890200PDR2GEVB,汽车开关稳压器,2-A,2-MHz 评估板
- EVAL-ADM1186-2MBZ,用于 ADM1186-2 四路电压序列发生器和监视器的微型评估板
- LTC2946HDE-1 6V 至 300V 高端电源、电荷和能量监视器的典型应用
- 使用 Diodes Incorporated 的 AP4300 的参考设计
- 花花流水灯
- 【航顺训练营】HKF103VET6开发板+677952A
- 使用 Infineon Technologies AG 的 IRU3039PBF 的参考设计
- #第七届立创电赛#小型功率分析仪
- 具有基本抑制功能的 LF33ABV 3.3V 极低压降稳压器的典型应用
- 抢答器图