I am trying to send ctrl+k keystroke through serial write to my computer. I am having troubles finding the correct HEX, ASCII, or Decimal for this. I get a compiler error when working my way. I understand that this is not a Leonardo or a FLASH DFU Arduino.
I have successfully sent the space command. I am using an additional program ACC Keys to capture the serial data.
Arduino UNO R3
IDE Arduino 1.0.6
Using Arduino: 1 Week
I would appreciate any help with either the proper search topic or help with code. I have spent two days looking for the key command without sending to a scanner or LCD display.
I don't understand the error and warning yet. I am sorry if this has been asked already.
Thank you for any help.
My Code
// Function changeColor will send the keystroke 'CTRL+K' to the computer
void changeColor () {
int KeyCommand[] = {0};
KeyCommand[0] = 11;
Serial.write(KeyCommand, 8);
}
Error
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
Arduino: 1.0.6 (Windows 7), Board: "Arduino Uno"
Photobooth2.ino: In function 'void changeColor()':
Photobooth2:98: error: no matching function for call to 'HardwareSerial::write(int [1], int)'
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:62: note: candidates are: virtual size_t HardwareSerial::write(uint8_t)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:63: note: size_t HardwareSerial::write(long unsigned int)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:64: note: size_t HardwareSerial::write(long int)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:65: note: size_t HardwareSerial::write(unsigned int)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/HardwareSerial.h:66: note: size_t HardwareSerial::write(int)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:54: note: size_t Print::write(const char*, size_t)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:53: note: virtual size_t Print::write(const uint8_t*, size_t)
C:\Program Files (x86)\Arduino\hardware\arduino\cores\arduino/Print.h:49: note: size_t Print::write(const char*)
Photobooth2.ino (3.7 KB)