Chobbs:
Hello,
Noob here.
I'm getting a error while programming for triggering a MIDI note to a electric piano.
"error: 'noteOn' was not declared in this scope"
There are several of these.
so I compared the other noteOn scripts.
It seems to be the same except for changing the note.
Any ideas where to start looking.
Thank You,
CVH
Using this code...
Errors are here
517:27: error:
526:27: error:
Also, Code offered from gist:7398948 ยท GitHub
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delaymotor);
digitalWrite(LaserPin, HIGH); //This is beam 6
delay(delaylaser);
if( (analogRead(0) > sensor ) && (f == 0) )
{
digitalWrite(13, HIGH);
noteOn(0x90, note6, 0x7F);
f++;
}
else if(analogRead(0) < sensor )
{
digitalWrite(13, LOW);
noteOn(0x90, note6, 0x00);
f = 0;
}
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delaymotor);
digitalWrite(LaserPin, HIGH); //This is beam 5
delay(delaylaser);
if( (analogRead(0) > sensor ) && (e == 0) )
{
digitalWrite(13, HIGH);
noteOn(0x90, note5, 0x7F);
e++;
}
else if(analogRead(0) < sensor )
{
digitalWrite(13, LOW);
noteOn(0x90, note5, 0x00);
e = 0;
}
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, HIGH);
digitalWrite(motorPin4, LOW);
delay(delaymotor);
digitalWrite(LaserPin, HIGH); //This is beam 4
delay(delaylaser);
if( (analogRead(0) > sensor ) && (d == 0) )
{
digitalWrite(13, HIGH);
noteOn(0x90, note4, 0x7F);
d++;
}
else if(analogRead(0) < sensor )
{
digitalWrite(13, LOW);
noteOn(0x90, note4, 0x00);
d = 0;
}
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, HIGH);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delaymotor);
digitalWrite(LaserPin, HIGH); //This is beam 3
delay(delaylaser);
if( (analogRead(0) > sensor ) && (c == 0) )
{
digitalWrite(13, HIGH);
noteOn(0x90, note3, 0x7F);
c++;
}
else if(analogRead(0) < sensor )
{
digitalWrite(13, LOW);
noteOn(0x90, note3, 0x00);
c = 0;
}
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, HIGH);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, LOW);
delay(delaymotor);
digitalWrite(LaserPin, HIGH); //This is beam 2
delay(delaylaser);
if( (analogRead(0) > sensor ) && (b == 0) )
{
digitalWrite(13, HIGH);
"517:27: error:" noteOn(0x90, note2, 0x7F);
b++;
}
else if(analogRead(0) < sensor )
{
digitalWrite(13, LOW);
"526:27: error:" noteOn(0x90, note2, 0x00);
b = 0;
}
digitalWrite(LaserPin, LOW);
digitalWrite(motorPin1, LOW);
digitalWrite(motorPin2, LOW);
digitalWrite(motorPin3, LOW);
digitalWrite(motorPin4, HIGH);
delay(delaymotor);
}
// Back to top.