Created
July 3, 2014 14:49
-
-
Save tado/9d3f2baac8efd913a726 to your computer and use it in GitHub Desktop.
EneTableRead01.pde
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ファイルを指定して電力データを読み込む | |
// クラス(Class)バージョン | |
EneTable ene; | |
void setup() { | |
// 画面初期化 | |
size(800, 1004); | |
frameRate(30); | |
textSize(8); | |
// データ読み込み用クラスEneTableをインスタンス化(初期化) | |
ene = new EneTable("20140318_ENE.CSV"); | |
} | |
// 結果を文字で表示 | |
void draw() { | |
// 背景 | |
background(0); | |
// 日付 | |
text(ene.date, 2, 10); | |
// 全体を少し右下へ | |
translate(2, 20); | |
// 行と列の数だけ繰り返し | |
for (int i = 0; i < ene.data.length-1; i++) { | |
for (int j = 0; j < 24; j++) { | |
// データの数値を文字で画面に表示 | |
text(ene.data[i][j], (width / 24.0) * j, 9 * i); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment