I'm making an IR Macro keyboard, and about 10% of the code is dedicated to the Keyboard
commands, would having Keyboard.begin()
and Keyboard.end()
in the method responsible for typing make any difference to the speed or size?
My code:
void decodeCode(){ // send the macros.
int pos = 0;
for(int i = 0; i<output.length(); i++){
if(output.charAt(i) == '$' && i!=output.length()-1){ //the $ is a symbol for "$pecial" characters
i++;
specialDecodeChar(output.charAt(i));
}
else if(output.charAt(i) == '%'){
Keyboard.releaseAll();
}
else{
Keyboard.press(output.charAt(i));
}
}
Keyboard.releaseAll();
}
I currently have Keyboard.begin()
in setup()
.