MorseKOB / PyKOB

Python implementation of a library for Morse and MorseKOB functionality
https://sites.google.com/site/morsekob/morsekob40
MIT License
4 stars 2 forks source link

MRT: Support a hardware selector switch to select operation #296

Closed AESilky closed 3 months ago

AESilky commented 7 months ago

For use in museum displays, it has been requested that a hardware 1 of 4 selector switch be supported. The switch would, for example, cause MRT to:

  1. Connect to Wire 300
  2. Connect to Wire 301
  3. 'Key' a text file (repeatedly)
  4. Energize the loop (no timeout, no sounding of code, no connection to a wire)
jchausler commented 7 months ago

Hi All,

I'm going to make a suggestion here. Back almost a decade ago Les put together a special version of MorseKOB called MorseWF for the Wells Fargo Museums and it rolled out to at least several of them. I saw it in service at both the Phoenix, AZ and Portland, OR museums half a dozen or more years ago. I think it was Covid which ended the displays. Sadly to our knowledge, none are still in service. There was some discussion about how wires were switched, much like what is described below and I suggested a replica cordless jack box. Replicas were constructed as the attached photos show. Inside each was an Arduino Uno R3 microcontroller.

The purpose of this was exactly as described in the email copied below. It directed the computer attached to the replica jack box to connect to one of three wires or with no plug in one of the three jacks, (standard open circuit quarter inch phone jacks and the two contacts on the plug shorted together within the plug handle). It did this by sending a single character to the host computer via a USB cable connected between the two every half a second, the USB cable also provided power to the Arduino. It worked very well.

The program Arduino I wrote itself was trivial. I've attached the source. It again, sent one of four ASCII characters to the host computer once every half second reporting on the condition of the box. The four characters and what each indicates are: & - No jack plugged in A - Jack one plugged in B - Jack two plugged in D - Jack three plugged in The reason for this pattern is that each jack is assigned a unique bit within the character making any short between jacks or other similar electrical problem easily identifiable and of course any other character was an error (simple shorts between the jacks would be indicated by the characters C, E, F and G).

I've also attached a simple Python program to run on the host computer to demonstrate this functionality and with modifications it could be modified and configured as a subroutine within the telegraph program to which wire to connect.

Just my two cents...

73, Chris Hausler

<>

// Jack Box

define serialRxPin 0

define serialTxPin 1

define jack1Pin 8

define jack2Pin 10

define jack3Pin 12

define ledPin 13

int ledState = LOW; int jackState;

void setup() { pinMode(ledPin, OUTPUT); pinMode(jack1Pin, INPUT_PULLUP); pinMode(jack2Pin, INPUT_PULLUP); pinMode(jack3Pin, INPUT_PULLUP); pinMode(serialRxPin, INPUT_PULLUP); pinMode(serialTxPin, OUTPUT); Serial.begin(9600); }

void loop() { jackState = 0x40; if (digitalRead(jack1Pin) == LOW) jackState |= 1; if (digitalRead(jack2Pin) == LOW) jackState |= 2; if (digitalRead(jack3Pin) == LOW) jackState |= 4; Serial.write(jackState); if (ledState == LOW) { digitalWrite(ledPin, HIGH); ledState = HIGH; } else { digitalWrite(ledPin, LOW); ledState = LOW; } delay(500); }

AESilky commented 5 months ago

I implemented the selector function in MRT and included an example selector spec file in the docs directory. Waiting for @Kevijeps to receive the selector hardware to test it out.

AESilky commented 3 months ago

@Kevijeps tested with the hardware selector switch and it's working well.

Closing this.