My need is a generator to test a PC program with keyboard inputs.
I intend to use Teensy2 to simulate a keyboard via the USB connector of the
PC and have started to test the following, using Teensuduino:
//*****
int counter = 0;
void setup() {
Keyboard.begin();
}
void loop() {
counter++;
Keyboard.print("counter ");
Keyboard.print(counter);
Keyboard.print(" x ");
delay(2000);
}
//*****
...which generates "counter 2 x counter 3 x ..." until stopped.
The final test program is planned to be a Linux script, with some other
preparations/procedures for testing the PC, ending with Teensy2
test program compilation and loading. E. g:
# Bash script
.
.
.
avr-gcc -Wall -mmcu=atmega32u4 -O1 test-program.c -o test-program
avr-objcopy -j .text -j .data -O ihex test-program test-program.hex
teensy_loader_cli -mmcu=atmega32u4 -w test-program.hex
# End of bash script
However, compilation with "avr-gcc..." requires header file/s in test-program.c in order to resolve "Keyboard.print", which is not
required when Teensudino is used.
I have not succeeded in finding which header file/s I need and where to find it/them.
I kindly ask for advises.
I intend to use Teensy2 to simulate a keyboard via the USB connector of the
PC and have started to test the following, using Teensuduino:
//*****
int counter = 0;
void setup() {
Keyboard.begin();
}
void loop() {
counter++;
Keyboard.print("counter ");
Keyboard.print(counter);
Keyboard.print(" x ");
delay(2000);
}
//*****
...which generates "counter 2 x counter 3 x ..." until stopped.
The final test program is planned to be a Linux script, with some other
preparations/procedures for testing the PC, ending with Teensy2
test program compilation and loading. E. g:
# Bash script
.
.
.
avr-gcc -Wall -mmcu=atmega32u4 -O1 test-program.c -o test-program
avr-objcopy -j .text -j .data -O ihex test-program test-program.hex
teensy_loader_cli -mmcu=atmega32u4 -w test-program.hex
# End of bash script
However, compilation with "avr-gcc..." requires header file/s in test-program.c in order to resolve "Keyboard.print", which is not
required when Teensudino is used.
I have not succeeded in finding which header file/s I need and where to find it/them.
I kindly ask for advises.