Close

Soldering and Wiring the Left Panel

A project log for modHCI Panel - The Ultimate CPU Control Panel

"Modular Human Computer Interface Panel" - An easy open source control panel for anyone and everyone - and it fits on a desk!

E. GramesE. Grames 08/26/2018 at 18:040 Comments

So, I just finished wiring the Left panel. I have the 8 buttons on pins D4-D11 and the lights on pins D12, D13 and A0-A5. Everything has a common Ground, and the buttons are Active Low so that I can fully utilize the INPUT_PULLUP feature of the Arduino boards.

Looking at the underside of the left panel.

None of the wires touch the desk...

So, after wiring it, I decided to run a quick test code to make sure the LEDs all work. Since it's a bit late, I didn't bother with adding the buttons to the code just yet. I'll do that tomorrow, as well as wire up the center panel. If I have time I may also consider wiring the right panel, but that one will be more complex anyway so I'm going to leave it for later. With that one I'm actually going to use custom-crimped Dupont cables, just to make it easier to interchange wires if something is incorrect.

The left panel, with all lights on.

If you want it, here is the code. Just a very simple light sequencing sketch, nothing too fancy.

---------- more ----------
void initiate (int x){
  analogWrite(A5, 255);
  delay(x);
  analogWrite(A5, 0);
  analogWrite(A4, 255);
  delay(x);
  analogWrite(A4, 0);
  analogWrite(A3, 255);
  delay(x);
  analogWrite(A3, 0);
  analogWrite(A2, 255);
  delay(x);
  analogWrite(A2, 0);
  analogWrite(A1, 255);
  delay(x);
  analogWrite(A1, 0);
  analogWrite(A0, 255);
  delay(x);
  analogWrite(A0, 0);
  digitalWrite(13, HIGH);
  delay(x);
  digitalWrite(13, LOW);
  digitalWrite(12, HIGH);
  delay(x);
  digitalWrite(12, LOW);
}

void line (int y){
  analogWrite(A5, 255);
  delay(y);
  analogWrite(A4, 255);
  delay(y);
  analogWrite(A3, 255);
  delay(y);
  analogWrite(A2, 255);
  delay(y);
  analogWrite(A1, 255);
  delay(y);
  analogWrite(A0, 255);
  delay(y);
  digitalWrite(13, HIGH);
  delay(y);
  digitalWrite(12, HIGH);
  delay(y);
  analogWrite(A5, 0);
  delay(y);
  analogWrite(A4, 0);
  delay(y);
  analogWrite(A3, 0);
  delay(y);
  analogWrite(A2, 0);
  delay(y);
  analogWrite(A1, 0);
  delay(y);
  analogWrite(A0, 0);
  delay(y);
  delay(y);
  digitalWrite(13, LOW);
  delay(y);
  digitalWrite(12, LOW);
}

void on(){
  analogWrite(A5, 255);
  analogWrite(A4, 255);
  analogWrite(A3, 255);
  analogWrite(A2, 255);
  analogWrite(A1, 255);
  analogWrite(A0, 255);
  digitalWrite(13, HIGH);
  digitalWrite(12, HIGH);
}

void off(){
  analogWrite(A5, 0);
  analogWrite(A4, 0);
  analogWrite(A3, 0);
  analogWrite(A2, 0);
  analogWrite(A1, 0);
  analogWrite(A0, 0);
  digitalWrite(13, LOW);
  digitalWrite(12, LOW);
}

void setup() {
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  pinMode(11, INPUT_PULLUP);
  pinMode(12, OUTPUT);
  pinMode(13, OUTPUT);
  pinMode(A0, OUTPUT);
  pinMode(A1, OUTPUT);
  pinMode(A2, OUTPUT);
  pinMode(A3, OUTPUT);
  pinMode(A4, OUTPUT);
  pinMode(A5, OUTPUT);

  //cool init sequence
  initiate(100);
}

void loop() {
  initiate(200); // this is just a light test, we'll leave it running
  initiate(175);
  initiate(150);
  initiate(125);
  initiate(100);
  initiate(75);
  initiate(50);
  initiate(25);
  initiate(25);
  initiate(25);
  initiate(25);
  initiate(25);
  initiate(25);
  initiate(25);
  on();
  delay(1000);
  off();
  line(200);
  line(175);
  line(150);
  line(125);
  line(100);
  line(75);
  line(50);
  line(25);
  line(25);
  line(25);
  line(25);
  line(25);
  line(25);
  line(25);
  on();
  delay(1000);
  off();
}

Discussions