- Mon Jun 15, 2015 8:19 am
#182670
Hello Genius Hive Mind,
I am new to arduino, and would greatly appreciate any insight you would have into an issue I am running into with getting a particular part of code to work.
I reprogrammed a lilytwinkle with a Tiny AVR programmer successfully, and am trying to upload the sketch below to test some Morose code (which I've used in the past on a red board), however I keep receiving errors when I include the "dash" under void loop, and "void dash". The errors are " pin was not declared in this scope" and "dash was not declared in this scope". When I only have the coding for "dot" things work just fine. Would anyone please be able to offer advice for why this might be, and if there is a way to resolve it? Thank you so much for your time. Best, mgiven
int blinkPin = 0;
void setup()
{
pinMode(blinkPin,OUTPUT);
}
void loop()
{
dot(); dash(); // letter A
delay(3000); // 3 sec b/w loops
}
void dot()
{
digitalWrite(pin,HIGH); // dot ON
delay(250); // on for.25 sec
digitalWrite(pin,LOW); //dot OFF
delay(250); // off for .25 sec
}
void dash()
{
digitalWrite(pin,HIGH); // dash ON
delay(1000); // on for 1 sec
digitalWrite(pin,LOW); // dash OFF
delay(250); // off for .25
}
I am new to arduino, and would greatly appreciate any insight you would have into an issue I am running into with getting a particular part of code to work.
I reprogrammed a lilytwinkle with a Tiny AVR programmer successfully, and am trying to upload the sketch below to test some Morose code (which I've used in the past on a red board), however I keep receiving errors when I include the "dash" under void loop, and "void dash". The errors are " pin was not declared in this scope" and "dash was not declared in this scope". When I only have the coding for "dot" things work just fine. Would anyone please be able to offer advice for why this might be, and if there is a way to resolve it? Thank you so much for your time. Best, mgiven
int blinkPin = 0;
void setup()
{
pinMode(blinkPin,OUTPUT);
}
void loop()
{
dot(); dash(); // letter A
delay(3000); // 3 sec b/w loops
}
void dot()
{
digitalWrite(pin,HIGH); // dot ON
delay(250); // on for.25 sec
digitalWrite(pin,LOW); //dot OFF
delay(250); // off for .25 sec
}
void dash()
{
digitalWrite(pin,HIGH); // dash ON
delay(1000); // on for 1 sec
digitalWrite(pin,LOW); // dash OFF
delay(250); // off for .25
}