使用arduino UNO時常常會遇到一個問題就是LED太多接腳不夠用。
為了解決這個鳥問題,如果財力夠可以直接買一個Arduino Mega2560,很貴就是了。
今天介紹這顆74595是一顆8位元 串列輸入-並列輸出 帶閂鎖移位暫存器,照字面翻就是那麼長。
| sketch code |
| #include <IRremote.h> int RECV_PIN = 2; IRrecv irrecv(RECV_PIN); decode_results results; void setup() { pinMode(0, OUTPUT); irrecv.enableIRIn(); } void loop() { if (irrecv.decode(&results)) { irrecv.resume(); // Receive the next value if (results.value == 0x143226DB) digitalWrite(0, HIGH); if (results.value == 0x4E87E0AB) digitalWrite(0, LOW); } delay(100); } |
change internal clock of attiny85我一直以為,時脈的頻率會一起在上傳草稿碼的時候一起上傳,結果......