Browse Source

More buttonreader documentation

Sebastian Lohff 5 years ago
parent
commit
0c5d94d211
1 changed files with 27 additions and 0 deletions
  1. 27
    0
      Readme.md

+ 27
- 0
Readme.md View File

@@ -106,6 +106,33 @@ device, baudrate (default 9600), parity (default N) and stop-bits (default 1).
106 106
 As with the fifo, an ASCII-number for the player which pressed a button is
107 107
 expected. All other characters are ignored.
108 108
 
109
+*BeopardySerial* mimics the protocol used by the Beopary software. It reads
110
+from a serial device and takes the same arguments as *Serial*, but in addition
111
+to taking button presses from the serial it also gives feedback about the
112
+current gamestate.
113
+
114
+*Unix* opens up a unix domain socket on your local filesystem, first argument
115
+being the path to where it should be created. To send a player button press,
116
+send its ASCII number ('1'-'9' is supported). The board will send a 'O' if
117
+the buzzers (buttons) are open and a 'C' when they are closed. To indicate
118
+that it is a player's turn the board will send a "TX", where X is the current
119
+player's number (e.g. "T3" for player 3).
120
+
121
+Examples:
122
+
123
+	# use BeopardySerial
124
+	playerInput:
125
+	 - Type: BeopardySerial
126
+	   Args:
127
+	    - /dev/ttyUSB0
128
+	    - 19200
129
+
130
+	# use a unix domain socket
131
+	playerInput:
132
+	 - Type: Unix
133
+	   Args:
134
+	    - /tmp/seopardy.sock
135
+
109 136
 Writing an own class for player input should be fairly easy. Within its own
110 137
 thread the class can do whatever it wants (including blocking I/O). When it
111 138
 wants to signal a button was pressed it just needs to emit a ButtonEvent.

Loading…
Cancel
Save