[Home]AutoType

HomePage | RecentChanges | Preferences | My Website home page

Showing revision 25
I needed to automate typing a conversation, between two people over an App like a Chat Bot session.

eBay had sold me some DigSparks. I had heard about the Arduino Leonardo, but did not own any. eBay can supply then at an affordable price for a dabble.

Microchip do USB chips and the PIC14K50 is one of them. I tried to see if I could use them. Some notes: AutotypingMicrochip . Work in progress.

The Arduino example is very simple. Setting up the Arduino IDE takes less than an hour when using the Arduino Leonardo and my example.

The DigiSparks code for the Arduino IDE comes with a very simple example to use it as a HID keyboard.

It would be possible to add an AutoType Automata in the App code. This page also has links to other ways to automate typing using Microsofts cscript and wscript. There is also java robot and it is possible to get windows to press keys and move the mouse.

Use two and use the LED and inputs to handshake, so both were not typing over each other.

One input HALTs the typing - This is important when trying to reprogram them. The typing needs to be disabled.

Another input can be used to wait till the end of the sentence, before it starts typing another sentence.

This allows a ONESHOT or ASTABLE or CONTINUOUS way of working.

The Arduino IDE comes set up for the Arduino Leonardo. See here for DigiSparks

See http://www.dougrice.plus.com/dev/DigiSpark/LeonardoAutotypeFlipFlopWiredOr/LeonardoAutotypeFlipFlopWiredOr.ino

It needs some configuration to select Leonardo or DigiSpark, and if '\n' sends <ENTER>

early try:-

http://www.dougrice.plus.com/dev/DigiSpark/Keyboard_button3/

  timeline:-
     | pause     | typing |GA| PAUSE        | typing |GA| PAUSE        
     | typing |GA| PAUSE     | typing    |GA| PAUSE     | typing           
  Turn on LED 
  LED| off       | On        |  off         | on        | Off
  LED| on        | off       |  on          | off       | On

This web page tries out this idea, and allows other strategies to be tested: http://www.dougrice.plus.com/dev/DigiSpark/text2.html

In the end having one as master and the other as slave worked best.

The AtoD also offers options to select what it does.

It is important to be able to disable the typing when plugged in.

The DigiSparks are super, but it is also possible to use an Arduino Leonardo to Autotype? text in a loop.

Here are two later versions which can be configured to use the DigiSpark or Arduno Leonardo.

It was a bit of a challenge to get a version where one types while the other one waits for it to stop.

These may need configuration to select:

Handshaked version:- May need configuration http://www.dougrice.plus.com/dev/DigiSpark/LeonardoAutotypeFlipFlop/LeonardoAutotypeFlipFlop.ino

Wired Or version:- May need configuration http://www.dougrice.plus.com/dev/DigiSpark/LeonardoAutotypeFlipFlopWiredOr/LeonardoAutotypeFlipFlopWiredOr.ino

A solution that works it to have two inputs:

Have an output that is asserted

Another solution would be to have a Play Script that was typed out. The device would be given a part in the script. There would be a SYNC input so each character would not talk over each other.

The device being tested has a user who types, and a connection to a distant end over a modem or TCP/IP stream. An automata could be built into the device to inject characters as if typed or received from the remote end.

The picture below shows some of my kit used to AutoType. A DigiSpark is plugged into a SmartPhone using and OTG dongle.

Using a wired Or Bus to type in turn

Wire together so when one end types a sentence, the other one waits. It is not essential to use this. A switch can be used to ONE SHOT a sentence. It is possible to have more than two devices on the BUS. Two may assert the bus and start typing together.

Using DigiSparks:

Using Arduino Leonardos:

Arduino Leonardo:

The Arduino Leonardo is a microcontroller board based on the ATmega32u4.

It is easy to get the Arduino IDE to work.

 * https://www.arduino.cc/
 * https://www.arduino.cc/reference/en/language/functions/usb/keyboard/
 * https://www.arduino.cc/en/Tutorial/BuiltInExamples/KeyboardMessage

 * JavaScript Prototyping tool:-
 * http://www.dougrice.plus.com/dev/DigiSpark/text3.html

It is important to have an input to HALT the typing - This is important when trying to reprogram them. The typing needs to be disabled.

Another input can be used to wait till the end of the sentence, before it starts typing another sentence.

This allows a ONESHOT or ASTABLE or CONTINUOUS way of working.

The Arduino IDE comes set up for the Arduino Leonardo.

See http://www.dougrice.plus.com/dev/DigiSpark/LeonardoAutotypeFlipFlopWiredOr/LeonardoAutotypeFlipFlopWiredOr.ino

DigiSparks :

The Arduino IDE can be used with added tools. See Digisparks.

Bad Beetle - use Board: Arduino Leonardo :

These are easy to use, as the Arduino IDE can program them as - use Board: Arduino Leonardo

Arduino Pro Micro 16MHz and 8MHz crystals :

eBAy supply Arduino Pro Micro boards. They are smaller and fewer pins.

They use the same chip as the Leonardo, but if run at 3.3 volts they need an 8MHz clock instead of 16MHz clock used by the 5.5V Leonardo.

If you use the 8MHz version, they can be run at 3.3V or strapped to 5V.

The 8MHz version work if you select a different board

 *  
 * Arduino Pro Micro 8MHz
 *  Board: LilyPad Arduino USB
 *  Programmer: N/A - Arduino ISP 
 *  It does not have D11 so change to D10
 *

HomePage | RecentChanges | Preferences | My Website home page
This page is read-only | View other revisions | View current revision
Edited February 11, 2022 7:52 am by dougrice.plus.com
Search: