winnnnn
December 14, 2022, 3:19pm
1
#include <ipst.h>
void setup() {
OK();
while(in(12)==1){}
if(in(12)==0)
{
fd(30);
delay(11000);
ao();
beep(17);
}
else if
{
while(in(13)==1){}
if(in(13)==0)
{
fd(30);
delay(10000);
ao();
beep(17);
}
}
}
void loop() {
}
Please fix this problem for me or fix the program correctly. Thank you.
winnnnn
December 14, 2022, 3:23pm
3
Or do I just have to use else ?
What ware the names of the magic numbers used?
#include <ipst.h>
void setup() {
OK();
while (in(12) == 1) {}
if (in(12) == 0)
{
fd(30);
delay(11000);
ao();
beep(17);
}
else if
{
while (in(13) == 1) {}
if (in(13) == 0)
{
fd(30);
delay(10000);
ao();
beep(17);
}
}
}
void loop() {
}
2 problems fixed. Issue 1, no code tags. Issue number 2 not properly formatted.
Other problems become quite obvious with the fixing of those 2 problems.
winnnnn
December 14, 2022, 3:32pm
7
When I press the button connected to port 13, the motor doesn't turn, how do I fix it?
#include <ipst.h>
void setup() {
OK();
while (in(12) == 1) {}
if (in(12) == 0)
{
fd(30);
delay(11000);
ao();
beep(17);
}
else
{
while (in(13) == 1) {}
if (in(13) == 0)
{
fd(30);
delay(10000);
ao();
beep(17);
}
}
}
void loop() {
}
b707
December 14, 2022, 3:33pm
8
the first what you must to fix - insert code with code tags
Hello winnnnn
Why do you open a second thread?
winnnnn
December 14, 2022, 3:38pm
11
I asked the wrong question
b707
December 14, 2022, 3:39pm
12
winnnnn:
How to do it?
Did you read the forum guidelines ?
See also FAQ - Arduino Forum for general rules on forum behaviour and etiquette.
Hello,
Welcome to the Arduino Forum.
This guide explains how to get the best out of this forum. Please read and follow the instructions below.
Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is fru…
1 Like
winnnnn
December 14, 2022, 3:40pm
13
Hello, Welcome to the Arduino Forum. This guide explains how to get the best out of this forum. Please read and follow the instructions below. Being new here you might think this is having rules for the sake of rules, but that is not the case. If you don’t follow the guidelines all that happens is there is a long exchange of posts while we try to get you to tell us what we need in order to help you, which is frustrating for you and frustrating for us. The people who try to help with your pro…
I'm very sorry I haven't read it yet.
This will never get executed, revise your program logic
1 Like
b707
December 14, 2022, 3:42pm
15
As far I see - you asked almost the same question.
You shouldn't open more than one topic regarding to the same problem, it is a violation of the forum rules.
What did not suit you in the first topic? Didn't they fix your code?
You shouldn't wait for this. Nobody will do your tasks for you.
@winnnnn , do not cross-post. Threads merged.
alto777
December 14, 2022, 4:21pm
18
Where oh where is Caesar's underwear?
@Idahowalker fixed the syntax error that would have made it not compile, let alone execute.
iscp.h seems to be some kind of further Arduino-style distancing from real code ms reality, I assume in () is some kind of input function, so
while (in(12) == 1) {}
if (in(12) == 0)
{
looks like it waits for in (12) to go LOW, then double checks to make sure it did (!), and does execute the if block of code.
I think.
a7
system
Closed
June 12, 2023, 4:21pm
19
This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.