欧美极品高清xxxxhd,国产日产欧美最新,无码AV国产东京热AV无码,国产精品人与动性XXX,国产传媒亚洲综合一区二区,四库影院永久国产精品,毛片免费免费高清视频,福利所导航夜趣136

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 8641|回復: 5
打印 上一主題 下一主題
收起左側

st7735彩色液晶仿真(Proteus 8 +bascom avr單片機)

[復制鏈接]
跳轉到指定樓層
樓主
st7735的Proteus仿真測試


單片機源程序如下:
  1. '----------------------------------------------------------------------------'
  2. '                      ST7735R display library                             '
  3. '                         resolution 128x160                                 '
  4. '                                                                            '
  5. '                         BASCOM-AVR  2.0.8.0.                                '
  6. '                         Shilov Sergey ?017                                '
  7. '                            St-Peterburg                                    '
  8. '                               RUSSIA                                       '
  9. '                                                                            '
  10. '----------------------------------------------------------------------------'
  11. $regfile = "m8adef.dat"
  12. $crystal = 8000000
  13. $hwstack = 64
  14. $swstack = 64
  15. $framesize = 64

  16. '------------------------------- Setup -----------------------------------------
  17. $lib "glcd-ST7735R_april.lib"
  18. '$lib "glcd-ST7735R_march.lib"
  19. Config Graphlcd = Color , A0 = Portd.3 , Si = Portd.2 , Sclk = Portd.1 , Cs1 = Portd.4 , Rst = Portd.0       ' CS1 & Rst are optional

  20. Const Portrait = 0                                          '1=Portrait, 0=Landscape
  21. Const Rotate_180 = 0                                        '1=Rotated,  0=Not Rotated

  22. '------------------- Variables & Constants -------------------------------------
  23. Const Blue = &B00000011                                     ''predefined contants are making programming easier
  24. Const Yellow = &B11111100
  25. Const Red = &B11100000
  26. Const Green = &B00011100
  27. Const Black = &B00000000
  28. Const White = &B11111111
  29. Const Brightgreen = &B00111110
  30. Const Darkgreen = &B00010100
  31. Const Darkred = &B10100000
  32. Const Darkblue = &B00000010
  33. Const Brightblue = &B00011111
  34. Const Orange = &B11111000
  35. Const Violet = &B11100011

  36. Dim I As Byte , N As Byte , M As Byte , P As Byte
  37. '============================ Main prog ========================================
  38. Initlcd

  39. Cls

  40. Do

  41. #if Portrait = 0

  42.    Boxfill(0 , 0) -(159 , 127) , Green
  43.    Boxfill(0 , 0) -(159 , 127) , Red
  44.    Boxfill(0 , 0) -(159 , 127) , Violet
  45.    Boxfill(0 , 0) -(159 , 127) , Yellow
  46.    Boxfill(0 , 0) -(159 , 127) , Blue

  47.    Line(0 , 0) -(159 , 0) , Yellow
  48.    Line(0 , 0) -(0 , 127) , Yellow
  49.    Line(0 , 127) -(159 , 127) , Yellow
  50.    Line(159 , 0) -(159 , 127) , Yellow

  51.    Pset 1 , 1 , Yellow
  52.    Pset 158 , 1 , Yellow
  53.    Pset 1 , 126 , Yellow
  54.    Pset 158 , 126 , Yellow

  55.    Box(2 , 2) -(157 , 125) , Yellow

  56.    For I = 1 To 63 Step 4
  57.       Circle(80 , 64) , I , Green
  58.    Next I

  59.    Setfont Color8x8
  60.    Lcdat 60 , 20 , "Display ST7735R" , Orange , Blue
  61.    Wait 1

  62.    Boxfill(0 , 0) -(159 , 127) , White
  63.    Showpic 40 , 24 , Clock

  64. #else

  65.    Boxfill(0 , 0) -(127 , 159) , Green
  66.    Boxfill(0 , 0) -(127 , 159) , Red
  67.    Boxfill(0 , 0) -(127 , 159) , Violet
  68.    Boxfill(0 , 0) -(127 , 159) , Yellow
  69.    Boxfill(0 , 0) -(127 , 159) , Blue

  70.    Line(0 , 0) -(127 , 0) , Yellow
  71.    Line(0 , 0) -(0 , 159) , Yellow
  72.    Line(0 , 159) -(127 , 159) , Yellow
  73.    Line(127 , 0) -(127 , 159) , Yellow

  74.    Pset 1 , 1 , Yellow
  75.    Pset 126 , 1 , Yellow
  76.    Pset 1 , 158 , Yellow
  77.    Pset 126 , 158 , Yellow

  78.    Box(2 , 2) -(125 , 157) , Yellow

  79.    For I = 1 To 63 Step 4
  80.       Circle(64 , 80) , I , Green
  81.    Next I

  82.    Setfont Color8x8
  83.    Lcdat 76 , 20 , "  ST7735R  " , Orange , Blue
  84.    Wait 1

  85.    Boxfill(0 , 0) -(127 , 159) , White
  86.    Showpic 24 , 40 , Clock

  87. #endif

  88. Wait 2

  89. Loop

  90. End

  91. '-------------------------------------------------------------------------------
  92. $include "color8x8.font"
  93. Clock:
  94. $bgf "Clock.bgc"
復制代碼


資料 st7735.zip (51.33 KB, 下載次數: 93)

分享到:  QQ好友和群QQ好友和群 QQ空間QQ空間 騰訊微博騰訊微博 騰訊朋友騰訊朋友
收藏收藏3 分享淘帖 頂 踩
回復

使用道具 舉報

沙發
ID:64765 發表于 2019-9-4 16:17 | 只看該作者
學習,謝謝分享。
回復

使用道具 舉報

板凳
ID:325485 發表于 2020-4-15 23:13 | 只看該作者
感謝分享,最近在找ST7735的I2C驅動,好像都是SPI通信驅動
回復

使用道具 舉報

地板
ID:332724 發表于 2020-4-23 14:25 | 只看該作者
學習,謝謝分享。
回復

使用道具 舉報

5#
ID:805239 發表于 2020-7-18 20:50 | 只看該作者
good luck very useful
回復

使用道具 舉報

6#
無效樓層,該帖已經被刪除
7#
無效樓層,該帖已經被刪除
8#
ID:718536 發表于 2021-9-5 01:08 | 只看該作者
哈里路 發表于 2020-4-15 23:13
感謝分享,最近在找ST7735的I2C驅動,好像都是SPI通信驅動

因為SPI是獨立時鐘口,傳輸可以更快,更穩。亂碼幾率小。
回復

使用道具 舉報

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

本版積分規則

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表