milc
Junior Member
Offline
Posts: 52
Bluesense board
Nov 26th , 2007, 11:15pm
hi, advanced users today, there was a small workshop on physical computing with a guy who manage a company for some arduino/wiring like boards called bluesense: http://www.bluemelon.org/index.php/Products/BlueSense_and_Processing it was fun but the problem is, that the guy has absolutely no experience with P5, and he only knows Max/msp, so he could not help me on a problem. when i lauch this simple code, which just do a very simple drawing with pressure sensor, import org.bluemelon.bluesense.*; Master master; AdcInputDevice adcIn; int last; int id; int pin; boolean setupAnalogIn() { System.out.println("Detecting device "+id+" \n"); // try to find our device within the next 5 seconds Device dev = master.detectDevice(id, 5 * 1000 * 1000); // device not found? if(dev==null) { System.err.println("Device "+id+" not found!\n"); return false; } adcIn = (AdcInputDevice)dev; // setup analogue input for 2.56V, 5 samples/sec and 10-bits resolution adcIn.requestSetConfiguration(2560, 5, 10); return true; } void setup() { adcIn = null; master = new Master(); // type your switchInputDevice id id = 1636; // the input pin pin = AdcInputDevice.ADCINPUT_P1; if (setupAnalogIn()) { // call yield every 1 ms. master.start(10); } size(1000,800); smooth(); frameRate(10); background(0); } void draw() { float x = adcIn.getLastSampledInput(pin); ellipse(x,height, 100,100); } /*public void stop() { System.out.println("stopping..."); master.close(); System.out.println("stopped"); }*/ then, it launches applet, and few seconds later, it quits while leaving P5 IDE untouched, but the applet quits suddenly... the guy has no idea why it does so, and I'm not able to find out if it's the problem with board or if I did something wrong in my code. (I already tried to reduce the frameRate and I think the code is too simple that I can't even imagine where could be an error) anyone has any idea? thanks,