跳到主要內容

k-shoot mania旋鈕 自製成功!

客官看圖~


開始拆解改裝

再來就是開心的解除封印的時間了呵~
紅圈就是卡住旋轉的地方
把它弄平就OK了~!


組裝回去其中一片方向改變
然後你會發現其中一個電組怎麼量都是0.............

接點都被外殼夾住了當然怎麼量都是0阿!!!
只好再拆開來貼個絕緣膠帶
轉轉看會不會妨礙選轉
沒問題就改造好了~!
電路長這樣~


以下隨便接XD


測試程式:
const int analogInPin = A0;
const int analogInPin1 = A1;
int newValue[2]={0,0};
int oldValue[2]={0,0};
int count = 0;
void setup() {
    // initialize serial communications at 9600 bps:
    Serial.begin(9600);
    
  oldValue[0] = analogRead(analogInPin) ;
  oldValue[1] = analogRead(analogInPin1) ;
}

void loop() {
      
    newValue[0]=analogRead(analogInPin);
    newValue[1]=analogRead(analogInPin1);
    rotary(oldValue,newValue);

    delay(10);
}
void msg(int outputValue,int outputValue1) {
    Serial.print(" outputValue: = ");
    Serial.print(outputValue);
    Serial.print("   val: = ");
    Serial.print(" outputValue1: = ");
    Serial.print(outputValue1);
    Serial.print("   val: = ");
    Serial.println(count);
}
int rotary(int oldval[2],int newval[2])
{

    int type = oldval[0] - newval[0];
    int type1 = oldval[1] - newval[1];

    if (newval[0] > 900 || newval[0] < 1) {
        if (abs(type1) > 20) {
            oldval[0] = newval[0];
            oldval[1] = newval[1];
            if (type1 < 0) {
                count++;
                msg(newval[0],newval[1]);
            } else {
                count--;
                msg(newval[0],newval[1]);
            }
        }
    } else if (newval[1] > 900 || newval[1] < 1) {
        if (abs(type) > 20) {
            oldval[0] = newval[0];
            oldval[1] = newval[1];
            if (type < 0) {
                count++;
                msg(newval[0],newval[1]);
            } else {
                count--;
                msg(newval[0],newval[1]);
            }
        }
    } else {
        if (abs(type) > 10 && abs(type1) > 10) {
            oldval[0] = newval[0];
            oldval[1] = newval[1];
            if (type < 0 && type1 < 0) {
                count++;
                msg(newval[0],newval[1]);
            } else if(type > 0 && type1 > 0) {
                count--;
                msg(newval[0],newval[1]);
            }
        }
    }
}



結論:
可變電阻兩片方向相反就是為了泥補這一區段
之後利用程式如其中一片在這範圍就不考慮,只考慮另一片
1K歐姆電阻是拿來限流用,盡量不要影響後面可變電阻分壓
1M歐姆電阻是接腳空接時拉5V下來,不要有雜訊
而且1M夠大跟可變電阻並連時不影響電阻值
補個影片~




留言

這個網誌中的熱門文章

小蟻智慧攝影機支援RTSP

來源: http://en.miui.com/thread-196713-1-1.html 小蟻智慧攝影機版本: 1.8.5.1l_201511061661(台灣版) 下載檔案 https://drive.google.com/file/d/0ByjBix7wpeJJY0ZWZXlvWl9Za1E/view?usp=sharing 把攝影機SD卡拿讀卡機讀取 把壓縮檔內的test資料夾放進SD根目錄 插回SD卡至攝影機 重開 攝影機會呈現橘燈並執行更新 等恢復至藍燈或是用app確認攝影機開啟 用VLC或相關程式讀取串流 Main stream:rtsp:// <CameraIP> :554/ch0_0.h264 Minor stream:rtsp:// <CameraIP> :554/ch0_1.h264 Audio stream:rtsp:// <CameraIP> :554/ch0_3.h264 Telnet與FTP開啟加上 # Telnet if [ ! -f "/etc/init.d/S88telnet" ]; then     echo "#!/bin/sh" > /etc/init.d/S88telnet     echo "telnetd &" >> /etc/init.d/S88telnet     chmod 755 /etc/init.d/S88telnet fi # FTP echo "#!/bin/sh" > /etc/init.d/S89ftp echo "tcpsvd -vE 0.0.0.0 21 ftpd -w / &" >> /etc/init.d/S89ftp chmod 755 /etc/init.d/S89ftp User:  root Password:  1234qwer 使用passwd改密碼 參考: http://en.miui.com/thread-224653-1-1.html

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

Voip SPA3000/9000 設定

架設Voip 1.Analog Telephone Adaptor (ATA) 一個類比電話轉換到基於數位VoIP電話網路 An ATA contains the following components: FXS Ports – Used for interfacing with analog telephones. RJ45 Ports – Used for interfacing with the LAN/WAN FXO Ports – Used for interfacing with the PSTN 2.網絡電話交換機(IPPBX) 能通過IP網提供語音、視頻以及即時消息通信。這些通信不僅可以在企業內部網上進行,也可以通過Internet與外網甚至PSTN(Public Switched Telephone Network)電話間進行。 3.網路電話(IPPHONE) SPA921、支援SIP應用程式或電話 SPA3000設定 參照: 安德森技術備忘板 參照 OSSLab 的設定設完發現會PSTN接到來電時 等到 PSTN Answer Delay 秒數過後將會自動接起外線 仍然等待Voip分機接起話筒可能會造成撥打者不必要的電話費 可能原因是 Off Hook While Calling VoIP  被設為Yes SPA9000設定 Wan Setup Internet Connection Settings Connection Type: DHCP Static IP PPPOE PPPOE,DHCP DHCP,PPPOE SIP Hunt Groups: 設定群組獵線 群組號碼為500,分機100-102, 響鈴300秒 回到SPA3000 PSTN Line Dial Plan 2: 來電時將轉接至群組 發現的問題: 剛開機使用SPA3000 LINE1 撥打至PSTN Line 分機 在打外線會導致所有分機都將無法在外線 開完機後先用其他分機撥打測試後就可正常使用