編寫mblock遇到的問題

2021-10-14 07:17:25 字數 2874 閱讀 5790

最近老闆讓我編輯mblock的擴充套件,儘管有乙個pdf教程,但是還是遇到了一點問題在這裡一一列出

1.

這個裡面說的大部分都能看懂,先看這個

2.介紹一下pdf裡面我不理解的東西,下面有注釋的,不能直接用的

"

,"setup"

:"ps2x.config_gamepad(13, 11, 12, 10, true, false);\ndelay(1000);\n"

,//初始化的函式

"inc"

:"#include \"ps2x_lib.h\""

,//預處理

"def"

:"ps2x ps2x;"

,//定義

"work":""

,//直接放在loop迴圈中

"loop":""

}],//-loop迴圈,不是loop迴圈

["w"

,"讀取遙控訊號"

,"1","

,"setup":""

,"inc":""

,"def":""

,"work"

:"ps2x.read_gamepad();\ndelay(20);\n"

,"loop":""

}],[

"w",

"引腳定義"

,"2","

,"setup":""

,"inc":""

,"def"

:"int dir1pina=2;\nint dir2pina=4;\nint speedpina=3;\nint dir1pinb=5;\nint dir2pinb=7;\nint speedpinb=6;\n"

,"work":""

,"loop":""

}],[

"w",

"前進( %n )"

,"前進"

,"200","

,"setup":""

,"inc":""

,"def"

:" "

,"work"

:" digitalwrite

(dir1pina,high)

;//直接編輯引腳功能

digitalwrite

(dir2pina,low)

;digitalwrite

(dir1pinb,low)

;digitalwrite

(dir2pinb,high)

;analogwrite

(speedpina,);

analogwrite

(speedpinb,

); ",

"loop":""

}],[

"w",

"後退( %n )"

,"後退"

,"200","

,"setup":""

,"inc":""

,"def":""

,"work"

:"

digitalwrite

(dir1pina,low)

;digitalwrite

(dir2pina,high)

;digitalwrite

(dir1pinb,high)

;digitalwrite

(dir2pinb,low)

;analogwrite

(speedpina,);

analogwrite

(speedpinb,

); ",

"loop":""

}],[

"w",

"左轉( %n )"

,"左轉"

,"200","

,"setup":""

,"inc":""

,"def":""

,"work"

:"

digitalwrite

(dir1pina,low)

;digitalwrite

(dir2pina,high)

;digitalwrite

(dir1pinb,low)

;digitalwrite

(dir2pinb,high)

;analogwrite

(speedpina,);

analogwrite

(speedpinb,

); ",

"loop":""

}],[

"w",

"右轉( %n )"

,"右轉"

,"200","

,"setup":""

,"inc":""

,"def":""

,"work"

:"

digitalwrite

(dir1pina,high)

;digitalwrite

(dir2pina,low)

;digitalwrite

(dir1pinb,high)

;digitalwrite

(dir2pinb,low)

;analogwrite

(speedpina,);

analogwrite

(speedpinb,

); ",

"loop":""

}],]

,"menus":,

"values":,

"translators"

:}

3.注意s2e檔案可以用記事本直接修改,但是必須要壓縮成zip格式!!,不然會找不到擴充套件包。。

4.想了想主要都在這個pdf中,仔細看基本大部分都可以搞出來,後面有問題再更新吧。

編寫爬蟲遇到的問題總結

1,編碼問題 設定檔案編碼格式utf 8 2.連線超時 異常或者設定timeout 沒有設定timeout引數,結果在網路環境不好的情況下,時常出現read 方法沒有任何反應的問題,程式卡死在read 方法裡,搞了大半天,才找到問題,給urlopen加上timeout就ok了,設定了timeout之...

關於編寫android程式遇到的問題

activity傳值至fragment fragment中的onactivityresult不被呼叫 1.檢查該fragment所屬的activity中,是否重寫了onactivityresult方法。如果是該種情況,請確保寫了super.onactivityresult override prot...

python編寫時遇到的小問題

with open information.txt r encoding utf 8 as f 一定要指定編碼方式,它和單純的open函式不一樣,不是預設是utf 8的編碼方式。print s s s s k,get price k val,val get price k 不同位元組的輸出時的對齊。...