Répondre au commentaire
user warning: Unknown column 'i18n.language' in 'where clause'
query: SELECT DISTINCT b.* FROM blocks b LEFT JOIN blocks_roles r ON b.module = r.module AND b.delta = r.delta LEFT JOIN i18n_blocks i18n ON (b.module = i18n.module AND b.delta = i18n.delta) WHERE (i18n.language ='fr' OR i18n.language ='' OR i18n.language IS NULL) AND ( b.theme = 'garland' AND b.status = 1 AND (r.rid IN (1) OR r.rid IS NULL) )ORDER BY b.region, b.weight, b.module in /var/alternc/html/o/orangeseeds/usr/drupal-6/modules/block/block.module on line 456.
6 channel version
//Have fun.
import processing.serial.*;
Serial port; // Create object from Serial class int valA; int valB; int valC; int valD; int valE; int valF; // this should have been some kind of 2-diminsional array, I guess, but it works. int[] valuesA; int[] valuesB; int[] valuesC; int[] valuesD; int[] valuesE; int[] valuesF;
PFont fontA; PFont fontB;
void setup() { Tools...Create Font. the "now" value.fontA = loadFont("CourierNewPSMT-48.vlw"); // "fontB" is a 14 pt font of some sort. It's what we use to showthe min and max values.fontB = loadFont("CourierNewPSMT-14.vlw"); // I wouldn't change the size if I were you. There are somefunctions that don't use Arduino can keep up with. doesn't work at all, rate to 19.2k or lower. that familiar it's better left off. }int getY(int val) {
} void draw() {String decoder = ""; while (port.available() >= 3) { // read serial until we get to an "A". decoder = port.readStringUntil(65); } // sanity check. make sure the string we got from the Arduino hasall the values inside.if ((decoder.indexOf("B")>=1) & (decoder.indexOf("C")>=1) &(decoder.indexOf("D")>=1) & (decoder.indexOf("E")>=1) & (decoder.indexOf("F")>=1)){ // decoder string doesn't contain an A at the beginning. it's at the end. valA=int(decoder.substring(0,decoder.indexOf("B"))); //println("A" + str(valA)); valB=int(decoder.substring(decoder.indexOf("B")+1,decoder.indexOf("C"))); //println("B" + str(valB)); valC=int(decoder.substring(decoder.indexOf("C")+1,decoder.indexOf("D"))); //println("C" + str(valC)); valD=int(decoder.substring(decoder.indexOf("D")+1,decoder.indexOf("E"))); //println("D" + str(valD)); valE=int(decoder.substring(decoder.indexOf("E")+1,decoder.indexOf("F"))); //println("E" + str(valE)); valF=int(decoder.substring(decoder.indexOf("F")+1,decoder.indexOf("A"))); //println("F" + str(valF)); } //shift the new values into the array, move everything else over by one for (int i=0; i<width-151; i++) { valuesA[i] = valuesA[i+1]; valuesB[i] = valuesB[i+1]; valuesC[i] = valuesC[i+1]; valuesD[i] = valuesD[i+1]; valuesE[i] = valuesE[i+1]; valuesF[i] = valuesF[i+1]; }// -151 because the array is 151 less than the width. remember we // saved room on the side of the screen for the actual text values. but I don't have the time really.// Draw out the now values with the big font. text(valA + 1, (width-140), 108-5); text(valB + 1, (width-140), 206-5); text(valC + 1, (width-140), 304-5); text(valD + 1, (width-140), 402-5); text(valE + 1, (width-140), 500-5); text(valF + 1, (width-140), 598-5); textFont(fontB); // Draw out the min and max values with the small font. // the h value (30,128,266,etc) is a function of height, // but I didn't bother to actually do the math. // I guess it's (98*n)+30 where n is 0,1,2,3,4,5, but I don't know // exactly how height (600) relates to 98... ((h/6)-2??) drawdata("0", width-90, 30, valuesA); drawdata("1", width-90, 128, valuesB); drawdata("2", width-90, 226, valuesC); drawdata("3", width-90, 324, valuesD); drawdata("4", width-90, 422, valuesE); drawdata("5", width-90, 520, valuesF); for (int x=150; x<width-1; x++) { // next line adjusts the color of the stroke depending on the xvalue. (fades out the end of the line) to the next value in the array. where I wanted them without that offsets a little, too. 6+((height/6)*0)+((height-1-getY(valuesA[x-150]))/6), (width)-1-x, 6+((height/6)*0)+((height-1-getY(valuesA[x-149]))/6)); 4+((height/6)*1)+((height-1-getY(valuesB[x-150]))/6), (width)-1-x, 4+((height/6)*1)+((height-1-getY(valuesB[x-149]))/6)); 2+((height/6)*2)+((height-1-getY(valuesC[x-150]))/6), (width)-1-x, 2+((height/6)*2)+((height-1-getY(valuesC[x-149]))/6)); 0+((height/6)*3)+((height-1-getY(valuesD[x-150]))/6), (width)-1-x, 0+((height/6)*3)+((height-1-getY(valuesD[x-149]))/6)); -2+((height/6)*4)+((height-1-getY(valuesE[x-150]))/6), (width)-1-x, -2+((height/6)*4)+((height-1-getY(valuesE[x-149]))/6)); -4+((height/6)*5)+((height-1-getY(valuesF[x-150]))/6), (width)-1-x, -4+((height/6)*5)+((height-1-getY(valuesF[x-149]))/6)); } void drawdata(String pin, int w, int h, int[] values) {text("pin: " + pin, w, h); text("min: " + str(min(values) + 1), w, h + 14); text("max: " + str(max(values) + 1), w, h + 28);} void check(int xx, int rr, int gg, int bb) {// floating point operations in Processing are expensive. // only do the math for the float (fading out effect) if // we have to. You can change 170 to 160 if you want it to // fade faster, but be sure to change the other 170 to 160 // and the 20 to 10. // (20 is the difference between 170 and 150) if (xx<=170) { float kick = (parseFloat(170-xx)/20)*255; // invert kick so the brighter parts are on the left side insteadof the right.stroke(rr,gg,bb,255-kick); } else { stroke(rr,gg,bb); }}/* This is the Arduino Code:
void setup() {
}void loop() {
}