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

標題: 4x4x4立方光制作(原理圖+源程序+制作教程 C語言開源) [打印本頁]

作者: 愛_51黑    時間: 2015-10-30 14:46
標題: 4x4x4立方光制作(原理圖+源程序+制作教程 C語言開源)
視頻:
http://www.tudou.com/v/ghx2i3JzdCI/&resourceId=0_04_02_99/v.swf




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



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

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

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

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

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

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

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

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

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

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

實物焊接圖
8

負極短接好后,就是連接到回路三極管了,我采用了跳線短接,即每一層的負極短接到萬能板,再通過跳線連接到回路三極管的C極,這樣立方光就有了電路回路(請根據(jù)原理圖理解)
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. }
復制代碼


更多資料請移步工作室百度網(wǎng)盤下載

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


4x4x4立方光.zip

3.21 MB, 下載次數(shù): 170, 下載積分: 黑幣 -5


作者: 月兒彎~    時間: 2015-12-12 23:47
樓主那個B0.B1.B2.B3是接哪里的?
作者: suoai    時間: 2016-1-16 22:43
下載試試看

作者: 大土豆ing    時間: 2016-5-28 13:49
51黑有你更精彩


作者: ANANJK    時間: 2016-6-2 08:15
謝謝
作者: 雙贏電子    時間: 2016-6-5 21:44
不錯一直也想做一個但是看看這大堆的二極管焊接制作就膽小,樓主有耐心呀,高手
作者: 小杰520晴    時間: 2016-6-8 11:56
很不錯哎
作者: 小杰520晴    時間: 2016-6-8 11:57
我也想做
作者: 一只迷失的鹿    時間: 2016-8-6 19:57
月兒彎~ 發(fā)表于 2015-12-12 23:47
**** 作者被禁止或刪除 內(nèi)容自動屏蔽 ****

請問你知道那個B0什么是接什么了么?
作者: xiaohaiqq    時間: 2017-3-24 00:04
感謝分享!!
作者: 1345541020    時間: 2017-11-28 13:48
試試看行不行
作者: 真滴有點帥哦    時間: 2017-12-1 12:29
同問,B0是接哪兒的啊,是控制一列層嗎?
作者: akzyzj    時間: 2018-2-9 00:16
謝謝分享               
作者: 呵..呵    時間: 2018-3-23 20:53
如果是PCB的,就更好了

作者: just123456    時間: 2018-12-11 08:18
謝謝樓主分享
作者: stolle    時間: 2019-4-22 16:09
靈感和學習效果的完美頁面..我對這項創(chuàng)新感到非常驚訝好主意,和我們在一起!不幸的是,我不懂你的語言,我嚴重依賴翻譯。謝謝分享。




歡迎光臨 (http://www.zg4o1577.cn/bbs/) Powered by Discuz! X3.1
主站蜘蛛池模板: 国产一级片精品 | 日韩1区| 国产视频在线一区二区 | 国产人成在线观看 | 国产精品永久免费视频 | 国产良家自拍 | 婷婷成人在线 | 一级黄色日本片 | 日韩欧美在 | 国产精品久久久久久久久久软件 | 伊人影院99| 日韩成人av在线播放 | 国产精品久久久久9999鸭 | 亚洲国产精品一区二区三区 | av永久免费 | 91社区在线观看播放 | 欧美在线天堂 | 蜜桃毛片 | 免费一级片 | 中文字幕av一区二区三区 | 国产视频精品区 | 天天干国产| 午夜天堂精品久久久久 | 日韩看片 | 一区二区三区免费 | 国产激情免费视频 | 久久综合一区二区三区 | 五月婷婷亚洲 | 亚洲精品一区中文字幕乱码 | 国产精品久久久久久亚洲调教 | 久久久久久久久国产精品 | 亚洲欧美另类在线 | 欧美一级二级在线观看 | 天天舔天天 | 日本人和亚洲人zjzjhd | 亚av在线| 亚洲国产欧美一区二区三区久久 | 国产精品久久久久久久久久久久午夜片 | 久久久久无码国产精品一区 | 在线观看国产视频 | 国产在线一区二区三区 |