This web site collects together a few ideas, demos, and experiments.

I am interested in sailing, and electronics. I also have an interest in PIC micro controllers, after using one to turn on a cassette recorder to record the Radio 4 Shipping forecast while on a yacht away from the marina.

Please follow the links at the top of the page.

Hobbies

This web page is a hobby site.

Ideas

At some point, my site will be migrated here.

Doug's Wiki

I use my wiki to write up a few thoughts and scribbles. They contain random thoughts not fully thought out.

To explore a problem, I can use use webpages, and javascript to experiment and explore. I can make notes in the code or webpage text.

The webpages are intended for the writer. It could be that the only other readers are random AI tools and chat bots.

This is a scrap book of notes and links.

My Wiki: http://ccgi.dougrice.plus.com/cgi-bin/wiki.pl [index] | https://www.dougrice.co.uk/cgi-bin/wiki.pl [index]

websites

My Web Site: http://www.dougrice.plus.com/ | http://ccgi.dougrice.plus.com/ | http://www.dougrice.co.uk | http://patrickpi.local:8080/

My github: https://github.com/doug-h-rice

Auto Type - Using the Arduino HID keyboard to type during a soak test

I had a need to type a stream of characters at about the speed you could type them on a Laptop Keyboard or smart phone.

The service is sumarised in the diagram below. The user types what they want to say and the Advisor types the response.

There is a need to soak test long duration calls. Doing it properly is very difficult. This solution is SMART with its workarounds.

I set up a call and positioned the cursor where I wanted the typing and then enabled my devices to AutoType. It was the best I could do at the time.

Example text typed, It took about 100 seconds to type the text below

The text below is typed with a random delay between each character. It repeats, optionally alternating between a fast and slow speed.

 ts: 00009761 ms GA
 This is BeeTea Engineer, DHR, making a test call.GA
 Please hang up the B-leg GA
 I am testing the new text relay app GA
 Hello Doug here GA
  Can you see my typing? GA
  The Quick brown fox jumps over the lazy dog GA
  I am testing the new telay relay app GA
   ts: 00113746 ms GA

More notes:- Auto Type Introduction | Auto Type - early notes

The App needed a slow stream of repeatable text to soak test it and fill up scroll buffers, over many minutes.

If both ends type at the same time, the conversation presented to the users get muddled and difficult to read.

It would be nice if the devices can type in turn. A bit of wire enables the devices to co-ordinate when they are typing.

 timeline:-
 A-leg: | typing |GA| waiting   | typing    |GA| waiting   | typing           
 B-leg: | waiting   | typing |GA| waiting      | typing |GA| waiting        

Below is a picture of various Atmel 32u4 based Arduino Leonardo variations AutoTyping into the App.

Possibly using this sketch: http://www.dougrice.plus.com/dev/DigiSpark/KeyboardRP2/KeyboardRP2.ino

An OTG cable can be used to plug an external keyboard into a smart phone.

An early simulation on a webpage:

http://www.dougrice.plus.com/dev/DigiSpark/text2.html - DigiSparks

and

http://www.dougrice.plus.com/dev/DigiSpark/text3.html - tries out different agregations

A simulation using WOKWI: AutoType simulation on Rasberry Pico

How does your simple automation tool read a smartphone screen or press buttons on the on screen keyboard?

How does the automation "hear" the GA?

What is available?

The Arduino Leonardo can be programmed as a USB Keyboard.

https://docs.arduino.cc/language-reference/en/functions/usb/Keyboard/

The Arduino Leonardo can also be programmed as a USB Keyboard and mouse, and it has digital inputs and outputs and serial ports.

A keyboard cannot see the screen, so use a wire to enable and co-ordinate blind typing

The USB keyboard cannot "hear" the other end or read what they are typing to wait for GA or a pause.

They have inputs and outputs which can be used to enable and co-ordinate when they are typing.

So the AutoType devices asserts an output low while it is typing and removes this assert when it stops typing and goes IDLE. It holds off starting to type until it sees IDLE.

Use one for the User and another one for the Advisor.

An Arduino Leonardo, Raspberry PICO, and DigiSpark can be programmed to press keys on a keyboard

You need to use the mouse to select the input box that you type into, then enable typing.

It is possible to use an external keyboard and OTG cable plugged into a smart phone.

Automating this is possible

Automating these is near impossible

Automation could be simplified if an agreed sequence of keystrokes triggered test events.

Below is a collection of Atmel 32u4 bases Arduino Leonardo and DigiSparks.

A Raspberry Pico can also be used.

Here are a collection of DigiSparks, Arduino Leonardo and other boards that use the Atmel 32u4 chips that support USB.

There was a need to soak test the App with what ever typing could be acheived, and the DigiSparks and example were available.

These pages write up some notes and ideas.

AutoType - Automating pressing keystrokes using DigiSparks , Arduino Leonardo and Raspberry Pico

DigiSparks - DigiSpark - https://www.instructables.com/Digispark-DIY-The-smallest-USB-Arduino/

The Arduino documentation had an example that sent keyboard keystrokes.

One example was:

https://github.com/arduino/ArduinoCore-mbed/blob/main/libraries/USBHID/examples/Keyboard/Keyboard.ino

The DigiSpark also came with a KeyBoard example.

https://github.com/digistump/DigisparkArduinoIntegration/blob/master/libraries/DigisparkKeyboard/examples/Keyboard/Keyboard.ino

I modified it, and here is a version just for the DigiSparks.

DigiSpark sketch ( 2025-09-04 ): http://www.dougrice.plus.com/dev/DigiSpark/digi3/digi3.ino

It types slowly, and a switch connected to input P2 can be used to enable / disable typing the next phrase. Shorting P0 to GND HALTS typing

After you position the cursor and select the input box where you normally type, plug the device in and it starts typing the list of phrases.

You can optionally use two or more DigiSparks connected together so they take turns typing.

They wait for P2 to go IDLE before typing their next phrase.

Getting the code to work on the different boards has made it a bit cluttered and over complicated.

Example text typed, It took about 100 seconds to type the text below


ts: 00009761 ms GA
 This is BeeTea Engineer, DHR, making a test call.GA
Please hang up the B-leg GA
 I am testing the new Text Relay app GA
 Hello Doug here GA
  Can you see my typing? GA
  The Quick brown fox jumps over the lazy dog GA
  I am testing the new Text Relay app GA
   ts: 00113746 ms GA

Conclusion

The Arduino HID Keyboard example provided a solution to provide the stream of typing for the soak testing.

Getting a device to see and read off a glass screen and understand the text typed by a remote keyboard is a massive challenge.

A bit of wire allows two devices take turns in typing.