running two macs with 2 teensy and Qlab

Status
Not open for further replies.
So I am currently able to mimic a spacebar on 2 Macbook pro's simultaneously. And I am trying to add an escape key.I have tried "we print esc" and that seems to do same as space but on pin 1, I also tried we print a h same deal mimics space bar on pin 1.Excuse my ignorance as this is new to me.
FYI I am trying to find a simple way to trigger and escape out of two macs playing Qlab I have the go part down but code was already made. So now I am slowly learning. I can assign any key to do several things.
Code:
/*
 * Button.pde
 */

void setup() {
  Serial.begin(9600);
  pinMode(10, INPUT_PULLUP);
  delay(5);
  pinMode(1, INPUT_PULLUP);
  delay(5);
}

void loop() {
  if (digitalRead(10) == HIGH) 
    delay(10);
  else 
    Keyboard.print(" "); // we print a space
    delay(10);

  if (digitalRead(1) == HIGH)
    delay(10);
 else 
    Keyboard.print(" "); // we print a h
  }



  // put your main code here, to run repeatedly:
 
Ok now I have A second question I am wondering if I can stack my 2 teensy 3.2's or lc's and wire my switches to the pins or sockets ? on the first unit I made the 2 teensy lc's are separate.
 
wondering if I can stack my 2 teensy 3.2's or lc's and wire my switches to the pins or sockets ?

I hope you can understand the guesswork that goes into trying to answer this sort of question. I'm guessing by "stack" you mean connecting all the pins between two Teensy boards? Also guessing the code looks similar to what you originally posted? Also assuming 2 USB cables from 2 computers?

You definitely do want to connect the GND pins between the 2 boards.

You should NOT connect the power pins (VIN, VUSB, 3.3V) between the boards, assuming each is powered by its own USB cable. The last thing you want to do is allow power from 1 computer to feed into the other.

The two input pins for the button can probably be connected. The most conservative approach would use a double throw button (2 physical contacts). With both boards running with INPUT_PULLUP mode, there is a very tiny amount of power that might flow if one computer is turned off, but it's probably far too low to damage anything.

The unused digital and analog pins can be connected between the boards.

You should not connect the reset or program pins. You don't want one of them to reset or put the other into programming mode.

This is all based on some guesswork about what you're doing. If you're connecting things differently than I've assumed, these answers could turn out to be wrong for some other circumstance than I've imagined.
 
Status
Not open for further replies.
Back
Top