so for now this is all i have. i haven't made much changes to the code.
allthough i've tried quite some different setups. allthough i can get no expected output.
Serial.println("\e{0 0p"); //set pixel location 0,0
Serial.println("\e[0;63;20f"); //set color rgb
Serial.println("\e{10 50L"); //draw line from current pos to 10,50
Serial.println("\e{20 20L");
Serial.println("\e{30 30L");
Serial.println("\e{40 40L");
void setup() {
Serial.begin(232558);//,0,'*');
Serial.write("\n"); //send <CR>
Serial.begin(115200);
Serial.write("\e[?10L") //set landscape mode
Serial.write("\e[2J"); // clear screen
delay(400);
}
// hello world program for the BV4308
void loop() {
int varPlus=0;
int i=0;
char buf[32];
Serial.println("\e[2J");
for (i = 0; i < 320; i++) {
Serial.println("\e[0;63;20f");
varPlus=analogRead(A0)/8;
snprintf(buf, 32, "\e{%d %dL", i, varPlus);
Serial.println(buf);
//delay(100);
}
delay(300);
i=0;
for (i = 0; i < 320; i++) {
Serial.println("\e[0;0;0f");
varPlus=analogRead(A0)/8;
snprintf(buf, 32, "\e{%d %dL", i, varPlus);
Serial.println(buf);
//delay(100);
}
delay(100);
i=0;
}
One more question though....
I need to record 320x analogRead to a array in memory, so i can (later in the script) overwrite the same values with a black color to erase them.I could write an array of 320 values but that might be a bit memory exhausting. I would do a "cls" but this is much to slow. so i have to do it this way. i just need it to remember these 320 values until lateron...
While an array of 320 values take up a lot of space, is there maybe a formula or little piece of code that does the same but without writing the entire array in the code?
for examle: when changes, write/add value to array. then: turn color to black, write entire array again.
There's run-length coding. That might work, but then again, it may give you more data than you started with.
Or delta coding. Or delta coding with Huffman.
The compression technique chosen depends on the nature and behaviour of the data.