I was wondering if you could create a entire function that can be named for int. One of my projects is a Morse code Translator, and I figured that doing digitalWrite(pin, var) is kinda a pain to work with. I was wondering if theres a way you can do it.
int Dot = digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(1000);
You can write a function called Dot but not the way you wrote it. Try this:
void Dot(void)
{
digitalWrite(13, HIGH);
delay(500);
digitalWrite(13, LOW);
delay(1000);
}
BTW the second delay should be the same length as the first.
Pete
dot : dash : interword-space = 1 : 3 : 7
gaps within a symbol are dot-length, gaps between symbols are dash-length.
how do i use the void dot then as in
do
{
dot
}
?!?!?!
how do i use the void dot then as in
do
{
dot
}
You have to call it:
dot ();
(Note: it is "function dot", not "void dot". "void" is the return type)