Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127671
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:20:10+00:00 2026-06-17T07:20:10+00:00

// Sketch 4-01 (From the book :) ) int ledPin = 13; int delayPeriod

  • 0
// Sketch 4-01 (From the book :) )
int ledPin = 13;
int delayPeriod = 250;

void setup()
{
   pinMode (ledPin, OUTPUT); 
}

void loop()
{
 flash(20, delayPeriod);
 delay(3000);
}

void flash(int numFlashes, int d))
{
  for (int i = 0; i < numFlashes; i ++)
  {

 digitalWrite(ledPin, HIGH);
delay(d);
digitalWrite(ledPin, LOW);
delay(d);

}
}

I’m following the process of this book but my IDE gives me the error “‘flash’ was not declared in this scope. Keep in mind, I’m new to programming and this is probably a basic error. Just trying to modify the blinking LED program.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:20:11+00:00Added an answer on June 17, 2026 at 7:20 am

    You must place a declaration of the function flash before it’s being used.

    Either place a prototype of the function before the loop function, like this:

    void flash(int numFlashes, int d);
    
    void loop
    {
        /* .... */
    }
    

    Or you place the whole function definition before the loop function.

    And by the way, you have a closing parenthesis to much in the function header. Which of these problems is the real culprit is hard to say without seeing the errors.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've got a sketch pulled from here : import processing.opengl.*; float a; void setup()
I have a Pjs sketch, which looks as follows: void setup(){ //setup stuff among
What's the correct way to detect, from Flash, when someone has started a drag
I'm passing information to a Processing sketch from a Django backend. The problem arises
I've created a processing sketch which saves each frame of point cloud data from
I want to create new work document from sketch with Python on Linux platform,
Please ignore all the stuff about whether you should or not go from Sketch
I have a sketch pad made in Flash AS3 like this one here: http://henryjones.us/articles/using-the-as3-jpeg-encoder
So I'm making a sketch that takes a two digit number from the usb
Let me sketch a scenario: A spec is handed to a developer who needs

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.