差分
このページの2つのバージョン間の差分を表示します。
両方とも前のリビジョン 前のリビジョン 次のリビジョン | 前のリビジョン最新のリビジョン両方とも次のリビジョン | ||
lecture:基礎ゼミナール [2018/06/12 11:03] – [x,y,zの送信] baba | lecture:基礎ゼミナール [2018/07/19 08:06] – [texの参考資料] baba | ||
---|---|---|---|
行 451: | 行 451: | ||
</ | </ | ||
- | ==== 論文を書いてみよう ==== | + | ===== 論文を書いてみよう |
https:// | https:// | ||
+ | <code c exp_pointing.pde> | ||
+ | // Tetsuaki Baba | ||
+ | // Processing のサンプルコード | ||
+ | // str_format: データ名をカンマ区切りで書いておく | ||
+ | PrintWriter output; | ||
+ | boolean flg_start = false; | ||
+ | String str_format = " | ||
+ | int count = 0; | ||
+ | float x, y; | ||
+ | int time_start; | ||
+ | |||
+ | void setup() { | ||
+ | pixelDensity(displayDensity()); | ||
+ | size(800, 600); | ||
+ | x = random(25, width-25); | ||
+ | y = random(25, height-25); | ||
+ | } | ||
+ | |||
+ | void draw() { | ||
+ | background(0); | ||
+ | if ( flg_start == false ) { | ||
+ | textSize(30); | ||
+ | text(" | ||
+ | return; | ||
+ | } | ||
+ | if ( sqrt( (x-mouseX)*(x-mouseX) + (y-mouseY)*(y-mouseY) ) < 25 ) { | ||
+ | x = random(25, width-25); | ||
+ | y = random(25, height-25); | ||
+ | output.print(str(millis()-time_start)+" | ||
+ | time_start = millis(); | ||
+ | count++; | ||
+ | if ( count == 10 ) { | ||
+ | flg_start = false; | ||
+ | output.flush(); | ||
+ | output.close(); | ||
+ | } | ||
+ | } | ||
+ | ellipse(x, y, 50, 50); | ||
+ | println(millis()); | ||
+ | } | ||
+ | |||
+ | void keyPressed() { | ||
+ | if ( key == ' ' ) { | ||
+ | flg_start | ||
+ | time_start = millis(); | ||
+ | count = 0; | ||
+ | |||
+ | if ( flg_start == true ) { | ||
+ | String filename = nf(year(), 4) + nf(month(), 2) + nf(day(), 2) + nf(hour(), 2) + nf(minute(), | ||
+ | output = createWriter( filename + " | ||
+ | output.println( str_format ); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | |||
+ | </ | ||
+ | |||
+ | ==== データ収集用リンク ==== | ||
+ | https:// | ||
+ | |||
+ | ==== 反応速度測定用プログラム ==== | ||
+ | <code c ext_response.pde> | ||
+ | // Tetsuaki Baba | ||
+ | // Processing のサンプルコード | ||
+ | // str_format: データ名をカンマ区切りで書いておく | ||
+ | PrintWriter output; | ||
+ | boolean flg_start = false; | ||
+ | String str_format = " | ||
+ | int count = 0; | ||
+ | float x, y; | ||
+ | int time_start; | ||
+ | |||
+ | void setup() { | ||
+ | pixelDensity(displayDensity()); | ||
+ | size(800, 600); | ||
+ | x = random(25, width-25); | ||
+ | y = random(25, height-25); | ||
+ | } | ||
+ | |||
+ | void draw() { | ||
+ | background(0); | ||
+ | if ( flg_start == false ) { | ||
+ | textSize(30); | ||
+ | text(" | ||
+ | return; | ||
+ | } | ||
+ | if ( time_start < millis() ) { | ||
+ | text(" | ||
+ | } | ||
+ | } | ||
+ | |||
+ | |||
+ | void keyPressed() { | ||
+ | if ( key == ' ' ) { | ||
+ | flg_start | ||
+ | time_start = millis()+(int)random(3000.0f, | ||
+ | |||
+ | |||
+ | count = 0; | ||
+ | |||
+ | if ( flg_start == true ) { | ||
+ | String filename = nf(year(), 4) + nf(month(), 2) + nf(day(), 2) + nf(hour(), 2) + nf(minute(), | ||
+ | output = createWriter( filename + " | ||
+ | output.println( str_format ); | ||
+ | } | ||
+ | } | ||
+ | if ( key == ' | ||
+ | output.print(str(millis()-time_start)+" | ||
+ | time_start = millis()+(int)random(3000.0f, | ||
+ | count = count + 1; | ||
+ | if ( count == 10 ) { | ||
+ | flg_start = false; | ||
+ | output.flush(); | ||
+ | output.close(); | ||
+ | } | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | ==== 計測データをグラフにしてみる ==== | ||
+ | Google SpreadSheetに集まったデータをグラフにしてみました.各グラフバーにくっついているのは標準偏差のことを指しています. | ||
+ | {{: | ||
+ | |||
+ | 上記エクセルグラフを含むデータ:{{ : | ||
+ | |||
+ | ==== TeXを使ってレポートを書く ==== | ||
+ | * https:// | ||
+ | |||
+ | * {{ : | ||
+ | * {{ : | ||
+ | |||
+ | ==== 反応速度データ ==== | ||
+ | * https:// | ||
+ | ===== 最終課題内容 ===== | ||
+ | |||
+ | ==== 概要 ==== | ||
+ | **開発したデバイス**を利用して,**パラメータの変更**により,**どの程度ポインティング時間が変化するか**を実験から論じる. | ||
+ | ただし,既存デバイスとの比較はしなくともよいが,余裕があればしてもよい. | ||
+ | ==== 開発したデバイスとは? ==== | ||
+ | 授業の中でArduino Microを利用し,マウスポインタを作成しました.マウスポインタの移動には加速度センサの値を利用しました. | ||
+ | 「上記例を応用した,よりポインティング作業が早くなるプログラムサンプル」を再び利用して,arduinoをマウスに一度変更 | ||
+ | します. | ||
+ | |||
+ | ==== パラメータの変更とは?==== | ||
+ | 対象となるプログラムの中で, | ||
+ | Mouse.move((505-x)/ | ||
+ | と記述された行がありますが,これはx, | ||
+ | ただしこの場合の505, | ||
+ | 微妙に値がことなるので注意してください.ここでいうところのパラメータとはそれぞれの移動量パラメータのことを | ||
+ | さしています. | ||
+ | |||
+ | 例えばサンプルコードをなるべく変更せずにマウスの移動速度を変化させる場合は, | ||
+ | (505-x)/a, (y-509)/a | ||
+ | のaを更に具体的になパラメータとして,a=1, | ||
+ | 変化するかを実験することで,マウスの移動速度とポインティング速度の関係性を明らかにできるようになります. | ||
+ | |||
+ | またこの他にもここで紹介した計算式以外でポインティング移動量をパラメータとして実験していただいても | ||
+ | 構いません. | ||
+ | |||
+ | ==== どの程度ポインティング時間が変化するか,とは? ==== | ||
+ | 上記で説明した実験手順で例えばa=5とa=10を実験したとします.このときにa=5の場合,ポインティング時間は平均800[ms]程度, | ||
+ | 一方a=10のときは1, | ||
+ | |||
+ | ==== 添削用論文の提出 ==== | ||
+ | * 締切:7月24日 17: | ||
+ | * 方法:kibacoの最終課題ページから論文を添付送信します. | ||
+ | * 提出フォーマット:PDFファイル(枚数の目安としては,2-6枚程度です.実験した内容や検討した事項により文章は大きく増減しますので,あまり枚数は気にせず,必要な情報を載せ,必要な議論を論じることに集中してください.) | ||
+ | | ||
+ | <WRAP center round important 60%> | ||
+ | 添削された論文はkibacoで利用している各自メールアドレス宛に届きます.なので,ed.tmu.ac.jp のメールチェックを忘れないようにお願いいたします. | ||
+ | </ | ||
+ | |||
+ | ==== FAQ ==== | ||
+ | * 質問:Arduinoにマウス/キーボードプログラムを書き込みしたところ,プログラムミスで,マウス/キーボードで制御不能なふるまいになってしまい,別のプログラムを記述することが困難になりました. | ||
+ | * 答え:https:// | ||
+ | |||
+ | ==== texの参考資料 ==== | ||
+ | * Cloud Latexの使い方(馬場が簡単に解説しました):https:// | ||
+ | * < | ||
+ | * 数式の書き方:http:// | ||
+ | * 図表の入れ方:http:// |