Problem with delay

#include <SoftwareSerial.h>
SoftwareSerial BluetoothSerial(1,0);
void setup()
{
Serial.begin(9600);
pinMode(8,OUTPUT);// open solenoid
}
void loop()
{
if ( Serial.available () > 0 )
{
static char input[16];
static uint16_t i;
char c = Serial.read ();
if ( c != ‘\r’ && i < 15 )
input[i++] = c;
else
{
input = ‘\0’;

  • i = 0; *
  • int number = atoi( input );*
  • }*
  • }*
  • BluetoothSerial.println(number);*
  • digitalWrite(8, HIGH);*
  • delay(number);*
  • digitalWrite(8, LOW);*
  • delay(1000);*
    }
    This code it no work. error ‘number’ in delay.
    My input is number no over 99999 from android.I want to read value one time. How does it work.
    Sorry,if you don’t understand my english is not good.
    Regards,
    Bob

As "number" is not in scope when you call delay it does not exist. Look up "scope" in C/C++.

Mark

That’s all ?
void loop()
{
int number;
if ( Serial.available () > 0 )
{
static char input[16];
static uint16_t i;
char c = Serial.read ();
if ( c != ‘\r’ && i < 15 )
input[i++] = c;

else
{
input = ‘\0’;

  • i = 0; *
  • int number = atoi( input );*
  • Serial.println( number );*
  • }*
  • }*
  • BluetoothSerial.println(1);*
  • digitalWrite(8, HIGH);*
  • delay(number);*
  • digitalWrite(8, LOW);*
  • delay(1000);*
    }
    Bob

Maybe again with code tags?
I'd make "number" static or global, because your serial handling is fatally flawed.

SoftwareSerial BluetoothSerial(1,0);

You can't do SoftwareSerial on the hardware serial pins. You can't do software serial output without calling the begin() method.

how does it work. please show you code

how does it work.

How does what work?

please show you code

OK. I showed myself some code. Hope that helped. Although, I really can't see how it could have.

blinkboat:
how does it work. please show you code

You do not understand much do you.
Before you post any more code learn how to so it properly. Read How to use this forum - please read. - Project Guidance - Arduino Forum
on how to do it and how to use this forum.
Then post your code correctly and it will no be mangled by the forum and we can see it all and tell you what is wrong, which is a lot.