void setup()
{
Serial.begin(115200);
}
void loop()
{
byte number; //a variable whose scope is the loop() function
for (int count = 0; count < 8; count++) //another local variable
{
if (count == 3)
{
number = random(256); //give the variable a value
showNumber(count, number); //pass the values to a function
delay(1000);
}
}
}
void showNumber(int theCount, byte theByte)
{
Serial.print("count is : ");
Serial.println(theCount);
Serial.print("the random number is : ");
Serial.println(theByte);
}