Hand-Held mini writer

Hej superhands,

i'm doing something very similar for an instrument i built, and would like suggest that you add at least a sixth button to your interface.

with 5 buttons you only get 32 combinations (including "no-button pressed"). Though this enough for 26 lowcase letters and some selected punctuation, i bet you will soon miss numbers from 0-9... i guess that you're building this thing with a one-hand use in mind, but still this is something to consider.

the number of combinations double with each additional button. In fact your input is a binary number going from 00000(zero) to 11111 (31).

Here's some code (testest, but ripped ou off context) to read 4 buttons as a binary number (a nibble).

//***************           kuk_BINARY   BUTTONS   STUFF  //**************

byte binaryButtons[4]      =  {2,3,4,5}; // pin numbers for your buttons
byte num_BinaryButtons=4;          //how many buttons
byte binaryInput        =  0x00;
byte last_binaryInput   =  0x00 ;
byte temp_binaryInput   =  0x00;

 byte getBinaryInput(){
    temp_binaryInput=0x00;
    for(int i=0; i<num_BinaryButtons; i++){
     /* Serial.print("READ BUTTON :");
      Serial.print(i,DEC);
      Serial.print(" ----- ");*/
      if(!digitalRead(binaryButtons[i])){ //buttons go to ground-> BUTTON PRESSED
        temp_binaryInput+= 0x01<<i;
       //Serial.println("PRESSED");
       // delay(100);
      }else{
       // Serial.println("NOT pressed");
       // delay(100);
      }
    }
    if(temp_binaryInput!= binaryInput){
      last_binaryInput=binaryInput;
      binaryInput=temp_binaryInput;
      temp_binaryInput=0x00;
      
     //  Serial.println(binaryInput,BIN);
     // delay(100);

   
    }

 return temp_binaryInput;
  }
//***************           FINISH kuk_BINARY   BUTTONS   STUFF  //**************

another thing to keep in mind is that you don't know when to read the input, it's theoretically impossible for the user to press all buttons at exactly the same time. that's why i thought your thumb button would act as trigger-button, but this would only give you 16 combinations, only half of the alphabet.

so if it wasn't for a one-hand device i would suggest using 8 input buttons + 1 trigger. With 8 buttons you don't even need to reinvent the encoding. The user could just enter ASCii values :slight_smile:

best,
kuk