It's silly but I can't store numbers (0 to 9) from the keyboard. My idea is to use the keyboard to enter numbers into an algorithm. In other words, imagine a calculator sketch where the input is the keyboard. I thought about using this:
int variable;
void keyPressed(){
if(key==0){
variable=0;
}
...
..but it seems too excessive to setup an if statement for every number. I also tried this:
println(key);
but that results nothing. It's annoying...it must be easy to enter numbers from the keyboard but I couldn't figure out how... Thank for your help in advance!
int variable;
void keyPressed(){
if(key==0){
variable=0;
}
...
..but it seems too excessive to setup an if statement for every number. I also tried this:
println(key);
but that results nothing. It's annoying...it must be easy to enter numbers from the keyboard but I couldn't figure out how... Thank for your help in advance!
1