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

 找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

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

4x4x4立方光制作(原理圖+源程序+制作教程 C語言開源)

  [復制鏈接]
跳轉到指定樓層
樓主
ID:94097 發表于 2015-10-30 14:46 | 只看該作者 回帖獎勵 |倒序瀏覽 |閱讀模式
視頻:





希望喜歡工作室作品的朋友將我們的作品和精神分享,我們堅持創新,堅持開源!轉載和引用請注明出處,禁止用于商業目的。
光立方原理圖:



14年注定是繁忙的一年,年初到現在,除了本職工作比較繁忙,再就是輔導學生參加單片機設計競賽。加上最近比較泛濫,都沒時間整理匯編教程。好像是在某一天,突然覺得這么渾渾噩噩下去實在是不行,于是鞭策自己跑到實驗室,開始枯燥的碼字。進過一段時間的努力,總算是小有收貨。
這次給大家的帶來的作品是4x4x4的立方光,可能大家覺得,之前我做的是8x8x8的,現在怎么越做越小了,其實不是這樣的。現在我帶領學生也在做16x16X16的立方光,但大的立方光就必須要用C語言寫了,我的C語言學的時間不長,基本上都是用到什么才去學,為了能更好的實現16x16x16立方光的控制,所以我先做了一個4x4x4的立方光,用C語言編程,感悟一下C語言的控制方式。視頻中的動畫平不多,因為我實在是沒時間來設計動畫了,有想做的朋友可以自己再加動畫。

制作步驟
一 材料請根據原理圖自行購買
二制作工具

焊接燈珠一向是比較麻煩的,但借助自己制作的工具來焊接,可以節約大量的人力和時間,所以這里簡要說明一向焊接模板的制作。
1

1是我用萬能版加排針搭建的,排針直接橫向的間距是7個洞,縱向的間距是8個洞,沒2個排針為一組,一次焊接好16組就可以了。
接下來是燈珠管腳的彎折,最好是用平口鑷子。燈珠的短管腳面向你,用鑷子把所有管腳向右90度彎折,如圖2

再把燈珠的長管腳(正極)向下90度彎折,如圖
3

燈珠的彎折只需要這兩步,然后就可以擺放到焊接模板上了,這里我以兩個燈珠的擺放為例如圖4

擺放好后,就可以焊接了,焊接好后,檢查是否有開焊虛焊等問題。焊好的點陣如圖4-1

驅動板的焊接,這次驅動電路我沒使用任何IC,而是三極管直接驅動,之所以選用8550,是因為三極管開關電路中,8550是低電平導通,避免了單片機上電就導通的問題。8550可承受的電流較于其他90系列三極管較大,最適合做led驅動。
每組三極管的焊接如圖所示
5

共陽極驅動三極管共需要16只,再加上4只回路控制,共20只,這里需要注意的是,共陽極三極管和回路三極管的焊接是不同的,詳細請參照原理圖。三極管的B極是通過單片機控制的,三極管的數量比較多,所以在板子背面就只能跳線了。
實物組裝
焊接好最小系統,驅動電路后,就可以組裝了。組裝之前檢查4個點陣高度是否一致,然后就直接插在母座上面。插好后,會發現燈珠的負極管腳還是懸空的。此時將每一層的負極管腳短接。注意!!!請參考下圖6

這里要強調是,不是每個點陣的負極短接,而是兩兩點陣之間的負極管腳短接。這里所說的每一層是豎直高度的,而不是之前焊接好的點陣。
這樣焊接好后,電路是不會點亮的,因為led燈珠此時的負極沒有構成回路,換句話說,負極還是懸空的。此時就需要用廢棄的管腳或跳線來把每一層的負極連接到萬能板的回路三極管上。我是用元件管腳連接的,由于顏色問題,圖片里看不清楚,所以我給大家做出了圖示圖7

實物焊接圖
8

負極短接好后,就是連接到回路三極管了,我采用了跳線短接,即每一層的負極短接到萬能板,再通過跳線連接到回路三極管的C極,這樣立方光就有了電路回路(請根據原理圖理解)
9



主程序:
  1. #include"stc12c5a.h"
  2. #include"INTRINS.h"
  3. #include"basic.h"
  4. #define sNum 0
  5. #define eNum 1600
  6. void Delay100us();
  7. void Timer0Init(void);
  8. Word temp=sNum,count=0;
  9. Byte code table[]={0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  10.                    0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  11.                                    0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  12.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  13.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  14.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xff,
  15.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,
  16.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xfe,0xfe,
  17.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xff,0xfe,0xfe,0xfe,
  18.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xff,0xff,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,
  19.                                    0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xff,0xfe,0xfe,0xff,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,
  20.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xfe,0xfe,0xff,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,//12
  21.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xff,0xfe,0xfe,0xff,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,//13
  22.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xff,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,//14
  23.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xff,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,//15
  24.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,//16

  25.                                    0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  26.                    0xfc,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  27.                                    0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  28.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  29.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  30.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfe,
  31.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,
  32.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfc,0xfc,
  33.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfc,0xfc,0xfc,
  34.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfe,0xfe,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,
  35.                                    0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfe,0xfc,0xfc,0xfe,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,
  36.                                    0xfc,0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfc,0xfc,0xfe,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,
  37.                                    0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfe,0xfc,0xfc,0xfe,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,
  38.                                    0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfe,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,
  39.                                    0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfe,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  40.                                    0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,//32

  41.                                    0xf8,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  42.                    0xf8,0xf8,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  43.                                    0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  44.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  45.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,0xfc,
  46.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xfc,
  47.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,
  48.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xf8,0xf8,
  49.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xf8,0xf8,0xf8,
  50.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xfc,0xfc,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,
  51.                                    0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xfc,0xf8,0xf8,0xfc,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,
  52.                                    0xf8,0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xf8,0xf8,0xfc,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,
  53.                                    0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xfc,0xf8,0xf8,0xfc,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,
  54.                                    0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xfc,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,
  55.                                    0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xfc,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  56.                                    0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,//48

  57.                                    0xf0,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  58.                    0xf0,0xf0,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  59.                                    0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  60.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  61.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,0xf8,
  62.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf8,
  63.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,
  64.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf0,0xf0,
  65.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf0,0xf0,0xf0,
  66.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf8,0xf8,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,
  67.                                    0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf8,0xf0,0xf0,0xf8,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,
  68.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf0,0xf0,0xf8,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,
  69.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf8,0xf0,0xf0,0xf8,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,
  70.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf8,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,
  71.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf8,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
  72.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,//64

  73.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
  74.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,
  75.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,// 67 全亮三次


  76.                                    0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,0xf1,
  77.                                    0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,0xf3,
  78.                                    0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,
  79.                                    0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,  //71

  80.                                    0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,
  81.                                    0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,
  82.                                    0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,
  83.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe, //75         上到下
  84.                                   
  85.                                    0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  86.                                    0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  87.                                    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,
  88.                                    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0, //79   前到后

  89.                                    0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,
  90.                                    0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,
  91.                                    0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,
  92.                                    0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,//83           右到左

  93.                                    0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,0xfe,
  94.                                    0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,0xfd,
  95.                                    0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,0xfb,
  96.                                    0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7,0xf7, //87        下到上

  97.                                    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0,
  98.                                    0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,
  99.                                    0xff,0xff,0xff,0xff,0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  100.                                    0xf0,0xf0,0xf0,0xf0,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,        //91

  101.                                    0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,
  102.                                    0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,
  103.                                    0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,
  104.                                    0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff,0xf0,0xff,0xff,0xff, //95

  105.                    0xfe,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  106.                                    0xfc,0xfc,0xff,0xff,0xfc,0xfc,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,
  107.                                    0xf8,0xf8,0xf8,0xff,0xf8,0xf8,0xf8,0xff,0xf8,0xf8,0xf8,0xff,0xff,0xff,0xff,0xff,
  108.                                    0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,0xf0,//99


  109.                                   


  110.                                    };



  111. void main()
  112. {
  113.   Byte m=0xfe,i;
  114.   Timer0Init();
  115. while(1)
  116. {
  117.   
  118.   if(temp<eNum)
  119.   {
  120.   for(i=0;i<8;i++)
  121.   {
  122.     P0=m;
  123.         P1=table[temp+i];
  124.         m=_crol_(m,1);
  125.         Delay100us();
  126.         P1=0xff;
  127.   }
  128.    m=0xfe;
  129.    P0=0xff;

  130.      for(i=0;i<8;i++)
  131.   {
  132.     P2=m;
  133.         P1=table[temp+i+8];
  134.         m=_crol_(m,1);
  135.         Delay100us();
  136.         P1=0xff;
  137.   }
  138.    m=0xfe;
  139.    P2=0xff;
  140.    }
  141.    else
  142.    temp=sNum;
  143. }
  144. }

  145. void Timer0Init(void)                //5毫秒@11.0592MHz
  146. {
  147.         IE=0x82;
  148.         AUXR |= 0x80;                //定時器時鐘1T模式
  149.         TMOD &= 0xF0;                //設置定時器模式
  150.         TMOD |= 0x01;                //設置定時器模式
  151.         TL0 = 0x00;                //設置定時初值
  152.         TH0 = 0x28;                //設置定時初值
  153.         TF0 = 0;                //清除TF0標志
  154.         TR0 = 1;                //定時器0開始計時
  155. }


  156. void T0_time() interrupt 1
  157. {
  158.    
  159.           TL0 = 0xA0;                //設置定時初值
  160.         TH0 = 0x15;                //設置定時初值
  161.         count++;
  162.         if(count==30)
  163.         {
  164.          count=0;
  165.          temp=temp+16;
  166.         }
  167. }

  168. void Delay100us()                //@11.0592MHz
  169. {
  170.         unsigned char i, j;

  171.         i = 2;
  172.         j = 15;
  173.         do
  174.         {
  175.                 while (--j);
  176.         } while (--i);
  177. }
復制代碼


更多資料請移步工作室百度網盤下載

工作室百度網盤: http://pan點baidu點com/share/home?uk=3691829170 包含工作室教學視頻、教學資料和網絡作品資料下載


4x4x4立方光.zip

3.21 MB, 下載次數: 170, 下載積分: 黑幣 -5

評分

參與人數 2威望 +5 黑幣 +3 收起 理由
suoai + 1 贊一個!
小白呂 + 5 + 2 贊一個!

查看全部評分

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

使用道具 舉報

沙發
ID:95892 發表于 2015-12-12 23:47 來自手機 | 只看該作者
樓主那個B0.B1.B2.B3是接哪里的?
回復

使用道具 舉報

板凳
ID:103515 發表于 2016-1-16 22:43 | 只看該作者
下載試試看
回復

使用道具 舉報

地板
ID:123674 發表于 2016-5-28 13:49 | 只看該作者
51黑有你更精彩

回復

使用道具 舉報

5#
ID:124608 發表于 2016-6-2 08:15 | 只看該作者
謝謝
回復

使用道具 舉報

6#
ID:116662 發表于 2016-6-5 21:44 | 只看該作者
不錯一直也想做一個但是看看這大堆的二極管焊接制作就膽小,樓主有耐心呀,高手
回復

使用道具 舉報

7#
ID:125826 發表于 2016-6-8 11:56 | 只看該作者
很不錯哎
回復

使用道具 舉報

8#
ID:125826 發表于 2016-6-8 11:57 | 只看該作者
我也想做
回復

使用道具 舉報

9#
ID:136172 發表于 2016-8-6 19:57 | 只看該作者
月兒彎~ 發表于 2015-12-12 23:47
**** 作者被禁止或刪除 內容自動屏蔽 ****

請問你知道那個B0什么是接什么了么?
回復

使用道具 舉報

10#
ID:151751 發表于 2017-3-24 00:04 | 只看該作者
感謝分享!!
回復

使用道具 舉報

11#
ID:254637 發表于 2017-11-28 13:48 來自手機 | 只看該作者
試試看行不行
回復

使用道具 舉報

12#
ID:255861 發表于 2017-12-1 12:29 來自手機 | 只看該作者
同問,B0是接哪兒的啊,是控制一列層嗎?
回復

使用道具 舉報

13#
ID:187096 發表于 2018-2-9 00:16 | 只看該作者
謝謝分享               
回復

使用道具 舉報

14#
ID:286719 發表于 2018-3-23 20:53 | 只看該作者
如果是PCB的,就更好了
回復

使用道具 舉報

15#
ID:443779 發表于 2018-12-11 08:18 | 只看該作者
謝謝樓主分享
回復

使用道具 舉報

16#
ID:432687 發表于 2019-4-22 16:09 來自手機 | 只看該作者
靈感和學習效果的完美頁面..我對這項創新感到非常驚訝好主意,和我們在一起!不幸的是,我不懂你的語言,我嚴重依賴翻譯。謝謝分享。
回復

使用道具 舉報

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

本版積分規則

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

Powered by 單片機教程網

快速回復 返回頂部 返回列表
主站蜘蛛池模板: 久久中文字幕一区 | 在线观看中文字幕视频 | 欧美电影网 | 亚洲欧美一区二区三区1000 | www.99精品 | 亚洲精品一区二区三区中文字幕 | 国产精品九九九 | 天堂一区在线 | 精品久久久久一区二区国产 | 日本中文字幕在线视频 | 免费色网址 | 毛片区| h在线看| 成人精品一区亚洲午夜久久久 | 国产东北一级毛片 | 日韩欧美三区 | 国产精品久久久久久久久久久免费看 | 中文字幕欧美一区二区 | 欧美日韩综合 | 91精品国产综合久久香蕉麻豆 | 在线观看中文字幕 | 九九综合 | 噜噜噜噜狠狠狠7777视频 | 国产精品日韩欧美一区二区三区 | 久久久性色精品国产免费观看 | 久久久久久一区 | 国内精品久久久久久 | 欧美区在线观看 | caoporn免费 | 日韩有码一区 | 国户精品久久久久久久久久久不卡 | 久久一热 | 插插插干干干 | 国产美女精品 | 日韩一区二区三区精品 | 久久久久久久久99精品 | 国产日韩欧美一区二区 | 亚洲成人av在线播放 | 亚洲人在线播放 | 国产精品综合久久 | 久久精品16|