Go Down

Topic: Make a pushbutton that types on an ipad (Read 410 times) previous topic - next topic

sirbull

Jan 03, 2013, 09:04 pm Last Edit: Jan 03, 2013, 09:06 pm by sirbull Reason: 1
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: [Select]
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);
 }
}

HazardsMind

My GitHub:
https://github.com/AndrewMascolo?tab=repositories

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy