跳到主要內容

發表文章

目前顯示的是 2月, 2016的文章

小米路由器 mini 中繼模式啟動noip ddns

vi /etc/config/ddns config 'service' 'myddns' option 'service_name' 'noip.com' option 'enabled' '1' option 'domain' 'yourhost.no-ip.org' option 'usernamUe' 'your_username' option 'password' 'your_password' option 'interface' 'wan' option 'ip_source' 'network' option 'ip_network' 'wan' ddnsd start https://wiki.openwrt.org/doc/howto/ddns.client wan 改成區網對外網卡就可以了 一樣可以抓到真實IP

taiko

#include "UsbJoystick.h" #define PIEZOTHRESHOLD 70 #define PADNUM 4 unsigned long time[PADNUM] = {0,0,0,0}; int tempval[PADNUM] = {0,0,0,0}; unsigned long buttontime[PADNUM] = {0,0,0,0}; void setup() {   UsbJoystick.setup(); } void loop() {   UsbJoystick.update();   for(int i = 0; i < PADNUM; i++) {     buttondelay(i);   }   UsbJoystick.sendMsg(); } void buttondelay(int pad){  if ((millis() - buttontime[pad]) > 10) {     int val = analogRead(pad);     if( val >= PIEZOTHRESHOLD ) {       if(tempval[pad]==0){         sendmsg(pad,tempval[pad]);       }       if (val>tempval[pad]){       tempval[pad]=val;       }     }else{       if (tempval[pad]>PIEZOTHRESHOLD){           tempval[pad]=0;       }     }  }else{ ...