僕の備忘録(PC、UN*X、ネットワーク関連が中心)なんです。
自分の書いたところは適当(な時とか)に書き換えますので御了承を。
とりあえずこんだけ。
int s = EOF ; void setup() { Serial.begin(115200); } void loop() { s = Serial.read(); if (! (s == -1)) Serial.print(s); }
make upload してからkermitで接続し、 abcと打鍵すると、
Connecting to /dev/ttyACM0, speed 115200 Escape character: Ctrl-\ (ASCII 28, FS): enabled Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- 979899
と出力された。
次はもう少しまともな文字にしないと。
大きさを変えずに右下(SouthEast)を切り取り、右下に合わせて 元画像と重ねる処理を10回繰り返す。
$ for num in `seq 10 ` > do echo $num > convert -crop -100-100 first.png second.png > composite -gravity SouthEast second.png first.png temp.png > mv temp.png first.png > done
打鍵がそのまま表示され、改行もされるようにしてみた。
int s = EOF ; void setup() { Serial.begin(115200); } void loop() { s = Serial.read(); if (! (s == -1)) Serial.write(s); if (s == 13) Serial.print('\n'); }
($HOME) C-Kermit>connect Connecting to /dev/ttyACM0, speed 115200 Escape character: Ctrl-\ (ASCII 28, FS): enabled Type the escape character followed by C to get back, or followed by ? to see other options. ---------------------------------------------------- hello hoge あいうえお
リンクはご自由にどうぞ。でもURLや内容が変った場合はあしからず。