Skip to content
Snippets Groups Projects
Commit 1323f833 authored by Lucas Stratmann's avatar Lucas Stratmann
Browse files

eckige Verkabelung und Korrektur der Pin-Zuweisungen

parent d0cfedd0
No related branches found
No related tags found
No related merge requests found
......@@ -164,7 +164,15 @@ public class GUI extends JFrame implements Runnable, ActionListener {
for (Point p:pos) {
Graphics2D g2 = (Graphics2D) g;
g2.setStroke(roundLine);
g2.drawLine(p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y, pinArduino.get(assignment[counter]).x+posArduino.x, pinArduino.get(assignment[counter]).y+posArduino.y);
if (counter>5) {
g2.drawLine(p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y, p.x+modules[i].getPosition().x, pinArduino.get(assignment[counter]).y+posArduino.y);
g2.drawLine(p.x+modules[i].getPosition().x, pinArduino.get(assignment[counter]).y+posArduino.y, pinArduino.get(assignment[counter]).x+posArduino.x, pinArduino.get(assignment[counter]).y+posArduino.y);
} else {
g2.drawLine(p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y, p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y+90-(counter)*10);
g2.drawLine(p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y+90-(counter)*10, pinArduino.get(assignment[counter]).x+posArduino.x, p.y+modules[i].getPosition().y+90-(counter)*10);
g2.drawLine(pinArduino.get(assignment[counter]).x+posArduino.x, p.y+modules[i].getPosition().y+90-(counter)*10, pinArduino.get(assignment[counter]).x+posArduino.x, pinArduino.get(assignment[counter]).y+posArduino.y);
//g2.drawLine(p.x+modules[i].getPosition().x, p.y+modules[i].getPosition().y, pinArduino.get(assignment[counter]).x+posArduino.x, pinArduino.get(assignment[counter]).y+posArduino.y);
}
counter++;
}
}
......
......@@ -34,7 +34,7 @@ public class ArduinoUno extends Modul {
private int led13 = 0;
public ArduinoUno(ImageIcon _icon,Simulator simu) {
int locx=100;
int locx=50;
int locy=50;
layerpane.setPreferredSize(new Dimension(587+locx, 418+locy));//587,418
JLabel chiplabel = new JLabel();
......
......@@ -85,7 +85,7 @@ public class Button extends Modul implements ActionListener {
}
public boolean connect(Arduino arduino) {
Pin tmpPin = arduino.getPin(3);
Pin tmpPin = arduino.getPin(5);
this.addPin(tmpPin);
tmpPin.setObserver(this);
......@@ -93,7 +93,7 @@ public class Button extends Modul implements ActionListener {
this.addPin(tmpPin);
tmpPin.setObserver(this);
tmpPin = arduino.getPin(5);
tmpPin = arduino.getPin(3);
this.addPin(tmpPin);
tmpPin.setObserver(this);
......
......@@ -63,7 +63,7 @@ public class RGB extends Modul {
public boolean connect(Arduino arduino) {
// TODO Pins= R G B ? Aktuell RBG
Pin tmpPin = arduino.getPin(9);
Pin tmpPin = arduino.getPin(11);
this.addPin(tmpPin);
tmpPin.setObserver(this);
......@@ -71,7 +71,7 @@ public class RGB extends Modul {
this.addPin(tmpPin);
tmpPin.setObserver(this);
tmpPin = arduino.getPin(11);
tmpPin = arduino.getPin(9);
this.addPin(tmpPin);
tmpPin.setObserver(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment