FrontPage














 String data[];
 void setup() {
   background(0);
   noLoop();
   size(180, 480); // դXɤ߼äͤˤäѹ(ͽ)
   String loadPath = selectInput(); // եϤ뤿Υեνи
   if (loadPath == null) {
     println("ե뤬򤵤Ƥޤ"); // ե뤬򤵤Ƥʤä
   } else {
     println(loadPath); // ե뤬򤵤줿顢եѥɽ
     data = loadPath; // CSVƥȤɤ߹

     for (int i = 1, i < data.length; i++) {
       String d[] = data[i].split(",");// ƥΥޤʸ Ǽ
       int val[] = int(d); // intѴ
     }
   }
 }

 // 3դν
 void drawLine(int i, float xval1, float yval1, float zval1, float xval2, float  yval2, float zval2){
   stroke(200,0,0);
   line(i, xval1, i, 250-xval2);
   stroke(0,200,0);
   line(i, 250-yval1, i, 250-yval2);
   stroke(0,200,0);
   line(i, 250-zval1, i, 250-zval2);
 }

 void draw() {
   for(int i = 1; i < data.length; i++) { // ޤդν
     drawLine(i, , , , , , ,  );  //
   }
 }
 








SimpleScope?








SimpleScopeArduinoFio?

 import processing.funnel.*;

 final int id = 5; // end device ID
 final int kChannles = 3;  // the number of channels to display

 //ĿŪʳĥ
 PrintWriter csvout;

 Fio fio;
 Scope[] scope;

 int startTime;
 int endTime;

 void setup() {
   size(340, 35+150*kChannles);
   frameRate(30);

   int[] moduleIDs = {id};
   fio = new Fio(this, moduleIDs, Fio.FIRMATA);

   scope = new Scope[kChannles];
   for (int channel = 0; channel < kChannles; channel++) {
     scope[channel] = new Scope(30, 35+150*channel, 200, 100, "A"+channel);
   }

   // ϥե̾ջ.csvפȤ롣
   String y = str(year());
   String mo = str(month());
   String d = str(day());
   String h = str(hour());
   String mi = str(minute());
   String s = str(second());
   csvout = createWriter(y+mo+d+h+mi+s+".csv");
   startTime = minute()*60+second();
 }

 void draw() {
   background(0);
   for (int channel = 0; channel < kChannles; channel++) {
     scope[channel].updateAndDraw(fio.iomodule(id).analogPin(channel));
    }
 }

 class Scope {
   private int l;
   private int t;
   private int h;
   private float values[];
   private int index = 0;
   private int points = 200;
   private String title;

   Scope(int l, int t, int w, int h, String title) {
     this.l = l;
     this.t = t;
     this.h = h;
     this.points = w;
     this.title = title;

     values = new float[this.points];
   }

   public void updateAndDraw(Pin pin) {
     values[index] = pin.value;

     smooth();

     textSize(12);
     text(title, l - 24, t - 8);
     text("1.0", l - 24, t + 8);
     text("0.0", l - 24, t + h);
     text("val: " + pin.value, l + points + 8, t + 8);
     text("max: " + pin.maximum, l + points + 8, t + 20);
     text("min: " + pin.minimum, l + points + 8, t + 32);
     text("avg: " + pin.average, l + points + 8, t + 44);

     // draw outlines
     stroke(200);
     noFill();
     beginShape();
     vertex(l - 1, t - 1);
     vertex(l + points, t - 1);
     vertex(l + points, t + h);
     vertex(l - 1, t + h);
     endShape(CLOSE);

     // draw the signal
     stroke(255);
     beginShape();
     for (int i = 1; i < points; i++) {
       vertex(l + i, t + h - values[(index + i) % points] * (float)h);
     }
     endShape();

     // ĿŪ˳ĥ
     csvout.println(values[0]+","+values[1]+ ","+values[2]);

     index = (index + 1) % points;
   }
 } 

 void keyPressed() {
   endTime = minute()*60+second();
   int time = endTime - startTime;
   csvout.println(time);
   csvout.flush(); // Writes the remaining data to the file
   csvout.close(); // Finishes the file
   exit(); // Stops the program
 }




SimpleScope?



WiiFunnel

TOTAL_DIGITAL_PINS


SimpleScope?


















http://ci.nii.ac.jp/naid/110007488161








SimpleScope? AccelerationSensor?


CiNii?






SimpleScope? http://www.atinfinity.info/wiki/index.php?Gainer%2F%E5%8A%A0%E9%80%9F%E5%BA%A6%E3%82%BB%E3%83%B3%E3%82%B5
http://gainer.cc/Cookbook/AccelerationSensor























































トップ   新規 一覧 単語検索 最終更新   ヘルプ   最終更新のRSS