Automated Typing demo - InterConnected DigiSpark boards.

The Digispark can be configured as a HID Keyboard. Useful for auto testing a typing app.

It has a USB port for the HID and three pins.

There are three pins P0, P1, P2. P1 has an LED so in an output.

We want an ASTABLE - when one end is typing, the other end backs off. Turn the LED on when Typing, if the other end has LED on, back off typing.

----|----|----|----|----|----|----|----|----|----|----|----|

              +---------+       
              |DigiSpark|
    +---------| P2      |==> USB HID keyboard
    | +-------| P1 LED  |
    | |  +----| P0 I/P  |  
    | |  |    +---------+   
    | |  +-- /DISABLE      P0 is used to disable typing  
    | |                    P1 is LED output  
    | |                    P2 is Fast / slow      
    | |  +-- /DISABLE   
    | |  |    +---------+       
    | |  |    |DigiSpark|
    | |  +----| P0      |
    +---------| P1 LED  |
      +-------| P2 I/P  |==> USB HID keyboard
              +---------+       

----|----|----|----|----|----|----|----|----|----|----|----|

The units type either fast or slow. When TYPING turn on the LED

LED __^---  Start of typing - back off 
LED --v___  GA  invitation to start typing 

The LED typing triggers a HOLDOFF timer,

If P2 connected to P1 on other chip 
	When LED on back off
	

HOLDOFF is reset wile typing is seen or activity on P2.

while( true ){
		While ( HOLDOFF ){ wait }
		Type up to the next EOL or GA		
}


DigiSpark 1: Text to be typed.

ds1_P0
ds1_P2 connected to ds2_P1
HID_1:


DigiSpark 2: Text to be typed.

ds2_P0 leak buffer
ds2_P2 connected to ds1_P1
HID_2:


ideas

 

while( true ){
		wait ( HOLDOFF )
		Type
		Pause
		
}

When GA sent set holdoff to a large value
If the LED at the other end goes off its an invite to type so set holdoff low

If silent and the other end starts typing holdoff longer
If typing and the other end starts more complex
If typing and mid phrase the other end starts more complex

Conway's Game of life comes to mind. Could this be applied?
https://playgameoflife.com/ 
  . . .
  . . .
  . . .
  
  * * *
  * * *
  * * *
  
There are 8 squares around one in the middle

for each itteration work out:

create	 Each cell with three neighbors becomes populated.

live	 Each cell with two or three neighbors survives.
die		 Each cell with one or no neighbors dies, as if by solitude.
		 Each cell with four or more neighbors dies, as if by overpopulation.