void adjustTiming() {
test = target + 1;
how stop it adjustTiming as reached to target is =125
void adjustTiming() {
test = target + 1;
how stop it adjustTiming as reached to target is =125
Please confirm me if the test variable be replaced by target? If yes, then --
void adjustTiming()
{
target = target + 1;
if(target == 125)
{
flag = true;
target = 0;
}
its not working after start from 1 (one).
target reached to 0.
1+1=2
1 2 3 4 5 6 and 125 should stop
Hi, @incsr
Is it anything to do with;
Tom....
![]()
Not clear to me.
void loop()
{
int State = digitalRead(stbPin);
if (State == HIGH && !done)
{
delay(1980);
digitalWrite(AxxPin, HIGH); // enable pullup now, preload output latch
pinMode(AxxPin, OUTPUT); // immediately becomes a driven HIGH
delay(1000);
pinMode(AxxPin, INPUT);
*how to run this two times DElay1980 and delay1990
Where is 1990 -- is it not 1000?
i want Run complete code two times
Post the complete sketch along with short description of the purpose ofthis sketch.
const byte AxxPin = 8;
const byte stbPin = 9;
bool done = false;
void setup()
{
pinMode(AxxPin, INPUT); // high impedance, not driving
pinMode(stbPin, INPUT);
pinMode(LED_BUILTIN, OUTPUT);
}
void loop()
{
int State = digitalRead(stbPin);
if (State == HIGH && !done)
{
delay(1980);
digitalWrite(AxxPin, HIGH); // enable pullup now, preload output latch
pinMode(AxxPin, OUTPUT); // immediately becomes a driven HIGH
delay(1000);
pinMode(AxxPin, INPUT); // release the line
done = true;
digitalWrite(LED_BUILTIN, HIGH);
}
}
What is the pupose of the posted sketch -- what does it do?
led on 1980 and then off and again on 1990
1. LED_BUILTIN is On for 1980 ms
2. LED_BUILTIN is Off for how long ms?
3. LED_BUILTIN is On for 1990 ms
4. LED_BUILTIN is Off for how long ms?
5. Repeat from 1.
so insert the same code two times in the sketch.
It's a very short description, I hope you can do better and make a bit more work when you write...
We need to try an "fill the spaces" based on your code, but it's still confusing me because the description doesn't match the code, starting from "led on and off" (no LED is controlled except for builtin), but also "i want Run complete code two times" isn't of any help for us.
You need to provide a better description of your target (aka "what the code should do") compared with your actual code (aka "what the current code does").
Just as an example, if the description was "if a button is pressed, start a sequence where turn the led on after 1980ms, then turn it off after 1000ms, then after more 1980ms turn it on again for 1000ms then stop" the sketch would pretty easy to make (but avoid "delay()", learn the usage of "millis()" instead!).
So, write a complete and understandable description of the desired flow, and we can give it a try.