Keyboard.h not supported

Dear Community…

I have code for a USB keyboard using the Arduino Pro mini. Whenever I try to compile, it asks me if the keyboard library is referenced.

Any ideas?

Here is the code:

#include <Keyboard.h>

#include <SoftwareSerial.h>

char ctrlKey = 'X';

static const int TX = 9, RX = 8;

SoftwareSerial Bluetooth(TX, RX);

void setup()
{
  Keyboard.begin();
  Keyboard.print("Test successful");
  delay(100);
  Keyboard.releaseAll();
  delay(1000);
}

void loop()
{
}

Here is the error message:
‘Keyboard’ not found. Does your sketch include the line ‘#include <Keyboard.h>’?

I have code for a USB keyboard using the Arduino Pro mini.

No, you don't.

Oh. Oops, sorry! Here, this is the (semi)finished code. It is meant for a chorded/keyer keyboard.

/*
 * This program is intended to be a modern typing assistant for mobile
 * devices and other such uses. Hopefully it will provide much higher
 * WPM once mastered.
 * 
 * Created by Cyberman112 on 12/29/16
 */

#include <Keyboard.h>
#include <SoftwareSerial.h>

//define bluetooth
static const int TX = 9, RX = 8;

//define keyboard chord locations
int key01 = 8;
int key02 = 7;
int key03 = 6;
int key04 = 5;
int key05 = 4;
int key06 = 3;
int key07 = 2;
int key08 = 1;

//Map bluetooth to SoftwareSerial
SoftwareSerial Bluetooth(TX, RX);

void setup()
{
  //map keyboard chords to pins
  pinMode(key01, INPUT_PULLUP);
  pinMode(key02, INPUT_PULLUP);
  pinMode(key03, INPUT_PULLUP);
  pinMode(key04, INPUT_PULLUP);
  pinMode(key05, INPUT_PULLUP);
  pinMode(key06, INPUT_PULLUP);
  pinMode(key07, INPUT_PULLUP);
  pinMode(key08, INPUT_PULLUP);

  //Begin Serial for diagnostics.
  Serial.begin(9600);
  
  //Begin keyboard for HID over bluetooth
  Keyboard.begin();
  
  //Print that you have gotten this far.
  Serial.println("Beginning operation.");
}

void loop()
{
  //define storage and translation values
  String ConcatTranslate = "";
  int BinaryChar = 0;
  
  //Convert keys01-07 to binary basic ASCII
  ConcatTranslate.concat() = String(digitalRead(key01));
  ConcatTranslate.concat() = String(digitalRead(key02));
  ConcatTranslate.concat() = String(digitalRead(key03));
  ConcatTranslate.concat() = String(digitalRead(key04));
  ConcatTranslate.concat() = String(digitalRead(key05));
  ConcatTranslate.concat() = String(digitalRead(key06));
  ConcatTranslate.concat() = String(digitalRead(key07));
  ConcatTranslate.concat() = String(digitalRead(key08));
  //Send binary value over serial
  Serial.println(ConcatTranslate);

  //translate from a string to an int
  BinaryChar = ConcatTranslate.toInt();
  //Send binary ascii over serial
  Serial.println(BinaryChar);

  //Write binary number from chorded keyboard to computer over bluetooth
  Keyboard.write(BinaryChar);
}

https://www.arduino.cc/en/Reference/MouseKeyboard

Mouse and Keyboard libraries

These core libraries allow a 32u4 based boards or Due and Zero board to appear as a native Mouse and/or Keyboard to a connected computer.

Use a board that supports keyboards (Leonardo, Micro, ....)

I thought the Pro Mini fit that bill.

The Arduino Pro Mini is a microcontroller board based on the ATmega328.

Oh. I must be confusing mini and micro or nano. So hard to keep track of all the boards.

Promini and Nano both use 328P. Promini has no USB/Serial. Nano has FT232 which does not support keyboard.

Micro & Leonardo use 32U4. It supports keyboards.

CrossRoads: Promini and Nano both use 328P. Promini has no USB/Serial. Nano has FT232 which does not support keyboard.

Micro & Leonardo use 32U4. It supports keyboards.

OK, I had mini and micro backwards.