mirror of
https://github.com/aster94/logic-analyzer.git
synced 2026-05-02 16:38:51 +03:00
Update processing_LA.pde
This commit is contained in:
@@ -2,6 +2,20 @@ import processing.serial.*;
|
|||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
Serial p;
|
Serial p;
|
||||||
|
|
||||||
|
////////////////////////////////////////////////
|
||||||
|
/*--------------------SETUP-------------------*/
|
||||||
|
|
||||||
|
//uncomment the line where your arduino/STM32 is connected
|
||||||
|
String LA_port = "/dev/ttyACM0"; //linux DFU
|
||||||
|
//String LA_port = "/dev/ttyUSB0"; //linux Serial
|
||||||
|
//String LA_port = "COM9"; //windows
|
||||||
|
|
||||||
|
//change it to true if you are using a STM32 instead of arduino
|
||||||
|
boolean STM32 = true;
|
||||||
|
|
||||||
|
/*------------------END SETUP-----------------*/
|
||||||
|
////////////////////////////////////////////////
|
||||||
|
|
||||||
|
|
||||||
//colors:
|
//colors:
|
||||||
int white = 255;
|
int white = 255;
|
||||||
@@ -71,7 +85,8 @@ boolean isDraggable = false;
|
|||||||
|
|
||||||
|
|
||||||
void setup () {
|
void setup () {
|
||||||
p = new Serial(this, "com3", 9600);
|
//p = new Serial(this, Serial.list()[0], 115200);
|
||||||
|
p = new Serial(this, LA_port, 115200);
|
||||||
p.bufferUntil('\n');
|
p.bufferUntil('\n');
|
||||||
|
|
||||||
size(1000, 460);
|
size(1000, 460);
|
||||||
@@ -172,13 +187,25 @@ void drawText() {
|
|||||||
int x=10;
|
int x=10;
|
||||||
int y=50;
|
int y=50;
|
||||||
|
|
||||||
for (int i = 8; i<=13; i++) {
|
if (STM32) {
|
||||||
line(x, y-20, xEdge, y-20);
|
|
||||||
line(x, y+10, xEdge, y+10);
|
for (byte i = 12; i<=15; i++) {
|
||||||
text ("Pin "+i, x, y);
|
line(x, y-20, xEdge, y-20);
|
||||||
y+=60;
|
line(x, y+10, xEdge, y+10);
|
||||||
|
text ("PB"+i, x, y);
|
||||||
|
y+=60;
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
|
||||||
|
for (byte i = 8; i<=13; i++) {
|
||||||
|
line(x, y-20, xEdge, y-20);
|
||||||
|
line(x, y+10, xEdge, y+10);
|
||||||
|
text ("Pin "+i, x, y);
|
||||||
|
y+=60;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// draw buttons
|
// draw buttons
|
||||||
fill(grey);
|
fill(grey);
|
||||||
|
|
||||||
@@ -207,7 +234,6 @@ void drawText() {
|
|||||||
getData();
|
getData();
|
||||||
xShift = -map(handleX, xEdge, width-handleW, 0, xEnd-900);
|
xShift = -map(handleX, xEdge, width-handleW, 0, xEnd-900);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user