An occasional keyboard for Picaxe


Senior Member
I was moved to devise a simple way to connect a keyboard facility to a Picaxe for occasional use. My original project (still not much further progressed) is a clock/calendar that can give reminders/alarms with explanatory messages at the appropriate times.

After some delving/research/Googling, I found this thread started by Busby. It uses a smartphone Morse app to flash the LED which is then interpreted by a light detector attached to a 28X2.

I have modified the code so that it can run on an 8M2. Timing is achieved by using a PWM output to generate interrupts. That uses up one input, C.3, connected to one output pin, C.2, as well as the light detector input C.1 so there's not much I/O left on an 8M2. I haven't tried it but I'm sure it will transfer readily to other M2s for more I/O. The program as listed simply outputs the detected text using sertxd. Lines 152 and 154 (commented out in the listing) allow the raw dots and dashes to be displayed. There's a dummy subroutine ProcessChar that should be used to deal with data in a real application.

The hardware was knocked together using oddments from my box of bits. The detector is a standard red LED, connected to a transistor and op-amp arranged as a comparator to get a clean signal. I fitted the detector into a guide with 2 raised edges to align the phone's light with the detector LED. I tried two Android apps, "Flashlight with Morse Code" and "LED Flashlight-Morse Code" and they both worked reliably. The latter and the Tesla app referred to in the original thread seem to have disappeared from the Play Store but there are lots of others.