跳到主要內容

發表文章

目前顯示的是 8月, 2014的文章

Arduino 滑鼠滾輪編碼器/旋轉編碼器

滑鼠拆下來的滾輪編碼器 時序為                      → CW A  -----------          -------------    HIGH                ----------                  LOW                      ← CCW B  --------          ----------------    HIGH             ----------                     LOW A B 1  1↓CW 1  0 0  0 0  1 1  1 1  0 0  0 0  1↑CCW 程式碼參考底下網址來源修改而來 #define ENCODER_A_PIN 2 #define ENCODER_B_PIN 3 unsigned long time = 0; long position = 0; long num = 0; void setup() { pinMode(ENCODER_A_PIN,INPUT); pinMode(ENCODER_B_PIN,INPUT); attachInterrupt(0, RotaryEncoder, LOW); Serial.begin(9600); time = millis(); } void loop() { while (num != position) { num = position; Serial.println(num); } } void RotaryEncoder(){ int temp =digitalRead(ENCODER_B_PIN); if ((millis() - time) > 3) { if ( temp == LOW) { position++; }else{ if ( temp == HIGH) position--; } } time = millis(); } 沒中斷版本 int trigger=0; void Rotar

apache2 access.log 訊息

 [23/Aug/2014:22:28:45 +0800] "GET http://www.baidu.com/?rands=18054347 HTTP/1.1" 200 504 "-" "-" apache 訪問被塞了外部網站,並回應200 要是上面塞的都是廣告,不就免費幫別人點廣告了嗎... 我的主機並沒有架設代理伺服器 為什麼回傳200呢? 原來200是回應客戶端, 並回傳預設主機網頁內容, 並不會存取外部網站 來源: https://wiki.apache.org/httpd/ProxyAbuse

MINT 17安裝 Pepper Flash Player For Chromium

Ubuntu 14.04 用戶可以通過以下命令安裝Pepper Flash Player For Chromium : sudo apt-get install pepperflashplugin-nonfree sudo update-pepperflashplugin-nonfree --install 如果你想使用Beta 版的Google Chrome 中的Pepper Flash Player ,那麼可以把第二個命令改為: sudo update-pepperflashplugin-nonfree --install --beta --unverified 如果想使用非穩定版的Google Chrome 中的Pepper Flash Player,那麼可以把第二個命令改為: sudo update-pepperflashplugin-nonfree --install --unstable --unverified 如果你想卸載這個Flash Player ,那麼請執行以下命令: sudo update-pepperflashplugin-nonfree --uninstall 來源: http://blog.csdn.net/ygzhong000/article/details/26160953