import gifAnimation.*; import processing.serial.*; import processing.video.*; Capture cam; // for Using WebCam Serial port; // for Using SerialPort PImage bg; //Background Image. int item = 8; Gif[] g = new Gif[item]; //String[] gifurl = new String[item]; String[] gifurl = {"https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif","https://fab.sfc.keio.ac.jp/gcode/gifanime.gif"}; //int[] iconx = new int[item]; int[] iconx = {20, 80, 140, 200, 260, 320, 380, 440}; //int[] icony = new int[item]; int[] icony = {100, 100, 100, 100, 100, 100, 100, 100}; String[][] gcode = new String[item][1000000]; //String[] gcodeurl = new String[item]; String[] gcodeurl = {"https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode","https://fab.sfc.keio.ac.jp/gcode/bunny3_headcut.gcode"}; int y; String[] sendgcode; int gcodesend = 0; Serial s; int[] result = new int[item]; void setup() { // Serial Connection Check println(Serial.list()); s = new Serial (this, Serial.list ()[0], 250000); // WebCam Check String[] cameras = Capture.list(); if (cameras.length == 0) { println("There are no cameras available for capture."); exit(); } else { println("Available cameras:"); for (int i = 0; i < cameras.length; i++) { println(cameras[i]); } // The camera can be initialized directly using an // element from the array returned by list(): cam = new Capture(this, cameras[0]); cam.start(); } // gcodesend = 0; // Background // The background image must be the same size as the parameters // into the size() method. In this program, the size of the image // is 640 x 360 pixels. bg = loadImage("https://fab.sfc.keio.ac.jp/gcode/bg.jpg"); size(500, 332); for(int i=0;i height) { y = 0; } for(int i=0; i0) { printstart(gcodesend); } } void mouseClicked() { for(int i=0; i 0) { sendgcode = gcode[gcodesend]; for (int i = 0 ; i < sendgcode.length; i++) { println( sendgcode[i]); s.write( sendgcode[i] + "\n"); } println("Print Finish!"); gcodesend = 0; } }