Skip to content

Instantly share code, notes, and snippets.

@BraveTea
Created February 3, 2017 22:37
Show Gist options
  • Save BraveTea/f29a2b51357cbcb7dd345773726a2d77 to your computer and use it in GitHub Desktop.
Save BraveTea/f29a2b51357cbcb7dd345773726a2d77 to your computer and use it in GitHub Desktop.
Assigning values to a function()
/* what you need to look for here is the "24" 8' DashedLine(24)
* and combine this with the "int len" in DashedLine(int len)
* those correspond. the 24 is the integer value (called for
* with int len) assigned to the function and thus giving
* "len" in the function the value of 24
*/
void setup() {
Serial.begin(9600);
// draw the menu box
DashedLine(24);
Serial.println("| Program Options Menu |");
DashedLine(24);
}
void loop() {
}
void DashedLine(int len)
{
int i;
// draw the line
for (i = 0; i < len; i++) {
Serial.print("-");
}
// move the cursor to the next line
Serial.println("");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment