Pages: [1]   Go Down
Author Topic: Make a pushbutton that types on an ipad  (Read 296 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 9
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi! I'm trying to figure out how to make a physical keyboard out of push buttons and the Arduino Leonardo,
but I'm having some problems...

I have a camera connector kit, and it works with the ipad even though a warning comes up that the USB device is not supported.

The problem is to get the arduino leonardo to speak as a regular keyboard... I have tried keyboard.write('L'); (regular letters)
hex's and even ascii code. They work on my mac, but won't respond on my iPad! Is there a library or some additional setup in the code
I need to have to talk to the iPad?

Here is a short version of my code so far...

Code:
int ButtonDelay = 100;

void setup() {
  // make pin 1-10 an input and turn on the
  // pullup resistor so it goes high unless
  // connected to ground:
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);
  pinMode(7, INPUT_PULLUP);
  pinMode(8, INPUT_PULLUP);
  pinMode(9, INPUT_PULLUP);
  pinMode(10, INPUT_PULLUP);
  
  Keyboard.begin();
}

void loop() {
  
  // ASCII 'A'
  if(digitalRead(0)==LOW){
    Keyboard.write(65);
    delay(ButtonDelay);
  }
  
  //Regular 'A'
  if(digitalRead(0)==LOW){
    Keyboard.write('A');
    delay(ButtonDelay);
  }
  
  //HEX 'B'
  if(digitalRead(2)==LOW){
    Keyboard.write(0x42);
    delay(ButtonDelay);
  }
}
« Last Edit: January 03, 2013, 03:06:35 pm by sirbull » Logged

Queens, New York
Offline Offline
Faraday Member
**
Karma: 67
Posts: 2945
"Of all the things I've ever lost, I miss my mind the most" -Ozzy Osbourne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Look at http://biosrhythm.com/?p=933
Logged

Created Libraries:
NPV2 (NewPasswordV2),  TFT_Extension, OneWireKeypad, SerialServo.
Will provide libraries if asked in PM or forum.

Pages: [1]   Go Up
Jump to: