hello I know ive been posting here allot recently but I've run into allot of problems with my current project.
basically I want to play the logic caplock keybaord with inputs from from make makey'd arduino leonardo.In logic you must hit the caps lock key then hit any key between A and L to generate a note. Ive tried pressing the caps key on my mac keybaord then keyboard.press/keyboard.print upper and lowercase letters in that range but the caps lock keyboard always disappears. logic is recognising the leonardo as a keyboard because I can trigger other lower case commands fine.
When I tried keyboard.print (CapsKey) it says
Caps key was not declared in this scope.
neither has actually hitting the capskey between the brackets yeiled any results.
here is my code. Would be really great if someone knew the solution. I have been searching the web but connot find a caps lock function in an Arduino reference. ?
include <MovingAvarageFilter.h>
MovingAvarageFilter movingAvarageFilter1(20);
MovingAvarageFilter movingAvarageFilter2(20);
boolean check1 = false;
boolean check2 = false;
void setup() {
Serial.begin(115200);
}
void loop() {
float output1 = movingAvarageFilter1.process(analogRead(0));
float output2 = movingAvarageFilter2.process(analogRead(1));
if (output1 < 200 ) { // you can change this parameter to fine tune the sensitivity
if (!check1){
Keyboard.print("d");
Serial.println(output1);
check1 = !check1;
}
}
if (output1 >600) {
if (check1){
check1 = !check1;
}
}
if (output2 < 590 ) { // you can change this parameter to fine tune the sensitivity
if (!check2){
Keyboard.print("s");
Serial.println(output2);
check2 = !check2;
}
}
if (output2 >600) {
if (check2){
check2 = !check2;
}
}
}