I should mention that I didn’t write this code but got it from HERE.
#include<Servo.h>
Servo myservo; // create a servo object
int redled=13; // declare the pins
int greenled=12;
int servopin=9;
int trigpin=6;
int echopin=5;
float distance;
float duration;
int datapin=7;
int clockpin=8;
int latchpin=3;
void setup(){
Serial.begin(9600);
pinMode(redled,OUTPUT); // declare the pinmode
pinMode(greenled,OUTPUT);
pinMode(servopin,OUTPUT);
pinMode(trigpin,OUTPUT);
pinMode(echopin,INPUT);
pinMode(datapin,OUTPUT);
pinMode(clockpin,OUTPUT);
pinMode(latchpin,OUTPUT);
myservo.attach(servopin); // declare servo object is connected to servo pin
}
int ping() // create a function {
digitalWrite(trigpin,LOW);
delayMicroseconds(10);
digitalWrite(trigpin,HIGH);
delayMicroseconds(20);
digitalWrite(trigpin,LOW);
duration= pulseIn(echopin,HIGH);
distance= duration*0.034/2; // distance is in cm
return(distance);
}
void loop() {
myservo.write(90); // set servo at 90 degree angle
float value;
value=ping(); // call the ping function
Serial.println(value);
delay(100);
if(value>20) {
digitalWrite(redled,LOW);
digitalWrite(greenled,HIGH);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B01010000); // move the car in forward direction
digitalWrite(latchpin,HIGH);
}
if(value<20&& value>15) {
digitalWrite(redled,HIGH);
digitalWrite(greenled,HIGH);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B01010000);
digitalWrite(latchpin,HIGH);
}
if(value<15) {
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B00000000); // stop the car
digitalWrite(latchpin,HIGH);
delay(1000);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B00101000); // first back the robo car
digitalWrite(latchpin,HIGH);
delay(1000);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B00000000); // then again stop
digitalWrite(latchpin,HIGH);
delay(100);
go(); // call go function
delay(2000);
}
myservo.write(90);
}
void go() {
int a;
int b;
myservo.write(0);
delay(1000);
a=ping();
myservo.write(180);
delay(1000);
b=ping();
if(a>b) {
digitalWrite(redled,HIGH);
digitalWrite(greenled,LOW);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B00010000); // move to the right side
digitalWrite(latchpin,HIGH);
} else if(a<b) {
digitalWrite(redled,HIGH);
digitalWrite(greenled,LOW);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B01000000); // move to the left side
digitalWrite(latchpin,HIGH);
} else if(a=b) {
digitalWrite(redled,HIGH);
digitalWrite(greenled,LOW);
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B00101000); // first back the robo car
digitalWrite(latchpin,HIGH);
delay(4000); // wait for 4 seconds
digitalWrite(latchpin,LOW);
shiftOut(datapin,clockpin,LSBFIRST,B01000000); // then move to right direction
digitalWrite(latchpin,HIGH);
delay(2000);
}
}
The error in full is:
sketch_may02a:31:3: error: expected initializer before 'digitalWrite'
digitalWrite(trigpin,LOW);
^
sketch_may02a:32:20: error: expected constructor, destructor, or type conversion before '(' token
delayMicroseconds(10);
^
sketch_may02a:34:15: error: expected constructor, destructor, or type conversion before '(' token
digitalWrite(trigpin,HIGH);
^
sketch_may02a:35:20: error: expected constructor, destructor, or type conversion before '(' token
delayMicroseconds(20);
^
sketch_may02a:36:15: error: expected constructor, destructor, or type conversion before '(' token
digitalWrite(trigpin,LOW);
^
sketch_may02a:38:3: error: 'duration' does not name a type
duration= pulseIn(echopin,HIGH);
^
sketch_may02a:39:3: error: 'distance' does not name a type
distance= duration*0.034/2; // distance is in cm
^
sketch_may02a:40:3: error: expected unqualified-id before 'return'
return(distance);
^
sketch_may02a:41:3: error: expected declaration before '}' token
}
^
exit status 1
expected initializer before 'digitalWrite'
Содержание
- Помогите решить ошибку в коде на ардуино
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- программа для уз парктроника
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- Компилятор считает мою прогу неправильной, пишет: «expected ‘)’ before ‘;’ token»
- Arduino.ru
- Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
- forum.arduino.ru
- Компилятор считает мою прогу неправильной, пишет: «expected ‘)’ before ‘;’ token»
- DIY Robotics Lab
- Correcting Arduino Compiler Errors
- (Intended) Errors and Omissions
- Line 1 Error
- Line 4 Error
- Line 6 Error
- Line 8 Error
- Line 11 Error
- Line 12 Error
- Line 13 Error
- Line 14 Error
- Line 15 Error
- Line 16 Error
- Line 17 Error
- Line 18 Error
- Success (or so it seems)
- Line 4 Error
Помогите решить ошибку в коде на ардуино
ошибка: expected initializer before ‘digitalWrite’ arduino
код
#include
Servo servo1;
byte my_speed = 140;
int delta = 80;
void setup() <
pinMode(4, OUTPUT); //выход мотора A1
pinMode(5, OUTPUT); //выход мотора A2
pinMode(6, OUTPUT); //выход мотора B1
pinMode(7, OUTPUT); //выход мотора B2
servo1.attach(3); // привязываем сервопривод к аналоговому выходу 11
//pinMode(13, OUTPUT); //питание датчика 1
pinMode(8, INPUT); //сигнал датчика левый
pinMode(9, INPUT); //сигнал датчика правый
pinMode(10, INPUT); //сигнал датчика кубов
//digitalWrite(13, HIGH); //включить датчик 2
Serial.begin (9600); // подключаем монитор порта
pinMode(11, OUTPUT); // назначаем trigPin (Pin8), как выход
pinMode(12, INPUT); // назначаем echoPin (Pin9), как вход
>
void FORWARD() <
digitalWrite(4, LOW);
digitalWrite(6, LOW);
analogWrite(5, my_speed);
analogWrite(7, my_speed);
>
void SPIN_LEFT() <
digitalWrite(4, LOW);
digitalWrite(6, LOW);
analogWrite(5, my_speed — delta);
analogWrite(7, my_speed + delta);
>
void SPIN_RIGHT() <
digitalWrite(4, LOW);
digitalWrite(6, LOW);
analogWrite(5, my_speed + delta);
analogWrite(7, my_speed — delta);
>
void CUBE_UP() <
int cm, duration
digitalWrite(4, LOW);
digitalWrite(6, LOW);
analogWrite(5, LOW);
analogWrite(7, LOW);
analogWrite(11, LOW);
delayMicroseconds(2);
digitalWrite(11, HIGH);
delayMicroseconds(10);
digitalWrite(11, LOW);
duration = pulseIn(12, HIGH);
cm = duration / 58;
if (cm Голосование за лучший ответ
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
программа для уз парктроника
Здравствуйте, не могу написать программу для ультразвукового парктроника, чтоб работал как тут
перепробовал разные варианты программ, вот последняя:
#include
void setup()
<
lcd.begin(16, 1);
pinMode(2, INPUT);
pinMode(8, OUTPUT);
pinMode(9, OUTPUT);
//lcd.setCursor(0, 1);
delay(100);
for(int i=0;i Войдите на сайт для отправки комментариев
1. Вставляйте код в сообщение, как написано в ЭТОЙ иснтрукции.
2. Почему у Вас два раза объявлено void setup() ?
3. Разберитесь с фигурными скобками в void setup() и void loop(), они не правильно расставлены.
3. Разберитесь и расставьте как положено точки с запятой ( ; ) в конце каждого оператора. Например пропущено после lcd.print(), pinMode() в void setup(), а также после delay() в void loop() .
4. Объявление всех переменных (pingPin, inPin, duration, inches, cm и других ) вынесите из setup() наружу перед setup().
вот тут схема парктроника
я не программист и не электронщик, мне трудно писать программы. За советы спасибо
вот тут схема парктроника
я не программист и не электронщик, мне трудно писать программы. За советы спасибо
Зачем мне схема, если у Вас ошибки в коде? Я указал на ошибки, Вы не исправили ни одной. К стати, не нужно было при вставке кода убирать нумерацию строк, чтобы на них можно было ссылаться . Вставьте код ещё раз , но обязательно с нумерацией строк. Тогда я точно укажу в каких строках ошибки.
P.S. Если Вы не программист и не электронщик, и ждёте что за Вас всё сделают — то пишите сразу в раздел » Ищу исполнителя «. Там за денежку делают. А тут только помогают, если что-то не получается. Но Вам всё равно придётся приложить некоторые усилия.
Я не про то, что за меня все сделают, а просто сказал
Мда, ещё раз внимательно посмотрел код — там полная каша и неразбериха. Вы надёргали откуда-то разных кусков кода и не удосужились их проверить и нормально совместить. Определитесь сначала с «железом» — дисплей в коде указан то однострочный (строка 05), то двухстрочный (строка 28). lcd.begin() должно быть только один раз в коде (синтаксис). Один и тот же пин (D8) в двух местах объявлен то на выход (строка 07), то на вход (строки 18, 31). Пины в коде не совпадают с пинами на схеме на кртинке (например в коде УЗ-дальномер подключен к 8 и 9, а на схеме к 6 и 7). Короче, Вы тупо взяли откуда-то два разных варианта инициализации void setup() и вставили их в один код не разобравшись что к чему.
По поводу синтаксических ошибок:
1) Не хватает точки с запятой ( ; ) в конце строк 29, 30, 31, 58
2) Строка 11 бессмысленна, т.к. нет тела цикла for, он ничего не выполняет. То, что должно выполняться внутри цикла for, должно быть обрамлено фигурными скобками (синтаксис)
3) Содержимое внутри void setup() и void loop() должно должно быть обрамлено фигурными скобками — открывающей и закрывающей. В строке 35 пропущена открывающая фигурная скобка (синтаксис). А в void setup() вообще каша: во-первых, нельзя объявлять два раза (строки 03, 26); во-вторых, опять же фигня с фигурными скобками — должна быть одна открывающая и одна закрывающая (синтаксис); в-третьих, объявлять переменные (строки 17-23) нужно до void setup(), то есть до строки 03.
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
Компилятор считает мою прогу неправильной, пишет: «expected ‘)’ before ‘;’ token»
Доброго всем времени суток!
Пишу простенькую программку для управления моторами через драйвер L293D.
pinMode (MOTORR, OUTPUT);
pinMode (MOTORRB, OUTPUT);
pinMode (MOTORL, OUTPUT);
pinMode (MOTORLB, OUTPUT);
помогите, плиз, че делать то??
У меня не возникает:
Спасибо, trembo, помогло!)))
заменил #define на int и все норм .
А вот если уберете ; и =, то с #define заработает:
И на будующее — код весь надо показывать.
Возникла подобная ошибка, не могу понять где что нетак?!
ОШИБКА — ROS_V3:20: error: expected unqualified-id before ‘bool’
смотри строку 15, что-то там не так
с 12 по 18 строку я все удалял, не помогло
SP — это указатель стека. Подберите для переменной какое-нибудь другое название, например, sp.
А вообще, совет на будущее: никогда не называйте переменные исключительно заглавными буквами.
в 20 строке, int SP, видимо SP определено как системная хрень
add: пока писал, уже подсказали.
Да, действительно, переименова, ошибка исчезла,спасибо! Так бы еще долго»пырхался» бы с поиском
Помогите плиз та же самая проблема
Какие скобки должны стоять в теле «for»?
Доброго времени суток.
Возникает ошибка
expected ‘)’ before ‘ <‘ token
не могу понять причину
после HIGH чегото не хватает . 🙂
Доброго времени суток.
Возникает ошибка
expected ‘)’ before ‘ <‘ token
не могу понять причину
а что непонятного в сообщении компилятора? английского не знаете? — так переведите гуглем.
написано же — не хватает скобки. И в сообщении об ошибке компилятор вам даже номер строки указывает
Источник
Arduino.ru
Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
forum.arduino.ru
Компилятор считает мою прогу неправильной, пишет: «expected ‘)’ before ‘;’ token»
Доброго всем времени суток!
Пишу простенькую программку для управления моторами через драйвер L293D.
pinMode (MOTORR, OUTPUT);
pinMode (MOTORRB, OUTPUT);
pinMode (MOTORL, OUTPUT);
pinMode (MOTORLB, OUTPUT);
помогите, плиз, че делать то??
У меня не возникает:
Спасибо, trembo, помогло!)))
заменил #define на int и все норм .
А вот если уберете ; и =, то с #define заработает:
И на будующее — код весь надо показывать.
Возникла подобная ошибка, не могу понять где что нетак?!
ОШИБКА — ROS_V3:20: error: expected unqualified-id before ‘bool’
смотри строку 15, что-то там не так
с 12 по 18 строку я все удалял, не помогло
SP — это указатель стека. Подберите для переменной какое-нибудь другое название, например, sp.
А вообще, совет на будущее: никогда не называйте переменные исключительно заглавными буквами.
в 20 строке, int SP, видимо SP определено как системная хрень
add: пока писал, уже подсказали.
Да, действительно, переименова, ошибка исчезла,спасибо! Так бы еще долго»пырхался» бы с поиском
Помогите плиз та же самая проблема
Какие скобки должны стоять в теле «for»?
Доброго времени суток.
Возникает ошибка
expected ‘)’ before ‘ <‘ token
не могу понять причину
после HIGH чегото не хватает . 🙂
Доброго времени суток.
Возникает ошибка
expected ‘)’ before ‘ <‘ token
не могу понять причину
а что непонятного в сообщении компилятора? английского не знаете? — так переведите гуглем.
написано же — не хватает скобки. И в сообщении об ошибке компилятор вам даже номер строки указывает
Источник
DIY Robotics Lab
Correcting Arduino Compiler Errors
(Intended) Errors and Omissions
What happens after you select the Arduino menu item Sketch -> Verify/Compile and you get error messages that your program failed to compile properly. Sometimes the compiler warnings help you spot the problem code. Other times the error messages don’t make much sense at all. One way to understand the error messages is to create some intentional errors and see what happens.
Create a new program named: LEDBlink_errors
This is one time when it is better to copy the following code so we don’t introduce more errors into the program than are already there.
If you run Verify/Compile command you should see a number of compiler error messages at the bottom of the dialog display.
Arduino Compiler Error Messages
Line 1 Error
Uncaught exception type:class java.lang.RuntimeException
java.lang.RuntimeException: Missing the */ from the end of a /* comment */
/*— Blink an LED —//
The error messages go on for several more lines without adding much information to help solve the problem. You will find a clue to the problem above the compiler message box stating:
“Missing the */ from the end of a /* comment */“.
The article “Introduction to Programming the Arduino” describes the comment styles used by C programs. The error on line 1 is caused by mixing the comment styles. The comment begins with the “/*” characters but ends with “//” instead of the “*/” characters. Correct the line as follows:
/*— Blink an LED —*/
Now, rerun the Verify/Compile command.
Line 4 Error
error: stray ‘’ in program
int ledPin = 23; \We’re using Digital Pin 23 on the Arduino.
This is another problem with incorrect commenting technique. In this line the “\” characters are used to begin a comment instead of the “//” characters. The correct line follows:
int ledPin = 3; //We’re using Digital Pin 3 on the Arduino.
Now, rerun the Verify/Compile command.
Line 6 Error
error: expected unqualified-id before ‘<’ token
void setup();
This is an easy mistake to make. The problem is the semicolon “;” at the end of a function declaration. The article “Learning the C Language with Arduino” contains a section about correct usage of semicolons. To correct this problem remove the semicolon as shown below:
void setup()
Now, rerun the Verify/Compile command.
Line 8 Error
In function ‘void setup()’:
error: expected `)’ before numeric constant/home/myDirectory/Desktop/myPrograms/arduino-0015/hardware/cores/arduino/wiring.h:102:
error: too few arguments to function ‘void pinMode(uint8_t, uint8_t)’ At global scope:
pinMode(ledPin OUTPUT); //Set up Arduino pin for output only.
The clue to this problem is found in the message “error: too few arguments to function ‘void pinMode(uint8_t, uint8_t)’“. The message includes a list of the function’s arguments and data types (uint8_t). The error is complaining that we have too few arguments. The problem with this line of code is the missing comma between ledPin, and OUTPUT. The corrected code is on the following line:
pinMode(ledPin, OUTPUT); //Set up Arduino pin for output only.
Now, rerun the Verify/Compile command.
Line 11 Error
error: expected constructor, destructor, or type conversion before ‘(’ token
loop()
In this line the type specifier for the function is missing.
To fix this problem place the data type for the function’s return type. In this case we’re not returning any value so we need to add the keyword void in front of the loop function name. Make the following change:
void loop()
Now, rerun the Verify/Compile command.
Line 12 Error
error: function ‘void loop()’ is initialized like a variable
The block of code that makes up the loop function should be contained within curly braces “<“ and “>”. In this line a left parenthesis character “(“ is used instead of the beginning curly brace “<“. Replace the left parenthesis with the left curly brace.
Now, rerun the Verify/Compile command.
Line 13 Error
error: expected primary-expression before ‘/’ token At global scope:
/The HIGH and LOW values set voltage to 5 volts when HIGH and 0 volts LOW.
This line is supposed to be a comment describing what the program is doing. The error is caused by having only one slash character “/” instead of two “//”. Add the extra slash character then recompile.
//The HIGH and LOW values set voltage to 5 volts when HIGH and 0 volts LOW.
Line 14 Error
error: ‘high’ was not declared in this scope At global scope:
digitalWrite(ledPin, high); //Setting a digital pin HIGH turns on the LED.
This error message is complaining that the variable “high” was not declared. Programming in C is case sensitive, meaning that it makes a difference if you are using upper or lower case letters. To solve this program replace “high” with the constant value “HIGH” then recompile.
digitalWrite(ledPin, HIGH); //Setting a digital pin HIGH turns on the LED.
Line 15 Error
error: expected `;’ before ‘:’ token At global scope:
delay(1000): //Get the microcontroller to wait for one second.
This error message is helpful in identifying the problem. This program statement was ended with a colon character “:” instead of a semicolon “;”. Replace with the proper semicolon and recompile.
delay(1000); //Get the microcontroller to wait for one second.
Line 16 Error
error: expected unqualified-id before numeric constant At global scope:
digitalWrite(ledPin. LOW); //Setting the pin to LOW turns the LED off.
This error can be particularly troublesome because the comma “,” after the variable ledPin is actually a period “.” making it harder to spot the problem.
The C programming language allows you to build user defined types. The dot operator (period “.”) is part of the syntax used to reference the user type’s value. Since the variable ledPin is defined as an integer variable, the error message is complaining about the unqualified-id.
digitalWrite(ledPin, LOW); //Setting the pin to LOW turns the LED off.
Line 17 Error
In function ‘void loop()’:
error: ‘Delay’ was not declared in this scope At global scope:
Delay(1000); //Wait another second with the LED turned off.
This error was caused by the delay function name being spelled with an incorrect upper case character for the letter “d”. Correct the spelling using the lower case “d” and try the Sketch Verify/Compile again.
delay(1000); //Wait another second with the LED turned off.
Line 18 Error
error: expected declaration before ‘>’ token
There is an extra curly brace at the end of this program. Delete the extra brace to correct this error.
Now, rerun the Verify/Compile command.
Success (or so it seems)
The compiler completed without any more error messages so why doesn’t the LED flash after loading the program on my Arduino?
Line 4 Error
No error message was given by the compiler for this problem.
int ledPin = 23; \We’re using Digital Pin 23 on the Arduino.
The Digital pins are limited to pin numbers 0 through 13. On line 4 the code is assigning a non-existant pin 23 to the ledPin variable. Change the pin assignment to pin 3 and the program should compile, upload to your Arduino and flash the LED if everything is wired properly on your breadboard.
int ledPin = 3; \We’re using Digital Pin 3 on the Arduino.
Источник
0 / 0 / 0
Регистрация: 02.03.2022
Сообщений: 8
1
02.03.2022, 15:36. Показов 679. Ответов 1
//При попытке подать энергию на пины ошибка expected constructor, destructor, or type conversion before ‘(‘ token
#include <IRremote.h> //библеотека
const int pinLed1 = 5;
const int pinLed2 = 6;
const int pinLed3 = 7;
const int pinLed4 = 8;
const int pinLed5 = 9;
const int pinLed6 = 10;
const int pinLed7 = 11;
const int pinLed8 = 12;//назв светиков
pinMode(pinLed1,OUTPUT);
pinMode(pinLed2,OUTPUT);
pinMode(pinLed3,OUTPUT);
pinMode(pinLed4,OUTPUT); //настраиваем пины
pinMode(pinLed5,OUTPUT);
pinMode(pinLed6,OUTPUT);
pinMode(pinLed7,OUTPUT);
pinMode(pinLed8,OUTPUT);
digitalWrite(pinLed1,LOW);
digitalWrite(pinLed2,LOW);
digitalWrite(pinLed3,LOW);
digitalWrite(pinLed4,LOW);
digitalWrite(pinLed5,LOW);
digitalWrite(pinLed6,LOW);
digitalWrite(pinLed7,LOW);
digitalWrite(pinLed8,LOW);
IRrecv irrecv(2); // пин подключения ИК датчика
decode_results results;
int bright = 90; //задаем яркость
void setup(){
irrecv.enableIRIn(); //включаем ик
}
void loop(){
if(irrecv.decode(&results)){
irrecv.resume();
}
if(results.value == 0xFFA25D){ //если нажата кнопка:
digitalWrite(pinLed1,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFF629D){ //если нажата кнопка:
digitalWrite(pinLed2,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFFE21D){ //если нажата кнопка:
digitalWrite(pinLed3,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFF22DD){ //если нажата кнопка:
digitalWrite(pinLed4,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFF02FD){ //если нажата кнопка:
digitalWrite(pinLed5,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFFC23D){ //если нажата кнопка:
digitalWrite(pinLed6,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFFE01F){ //если нажата кнопка:
digitalWrite(pinLed7,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFFA857){ //если нажата кнопка:
digitalWrite(pinLed8,HIGH);
results.value = 0; //стираем полученные данные
}
if(results.value == 0xFF9867){ //если нажата кнопка:
digitalWrite(pinLed1,LOW);
digitalWrite(pinLed2,LOW);
digitalWrite(pinLed3,LOW);
digitalWrite(pinLed4,LOW);
digitalWrite(pinLed5,LOW);
digitalWrite(pinLed6,LOW);
digitalWrite(pinLed7,LOW);
digitalWrite(pinLed8,LOW);
results.value = 0; //стираем полученные данные
}
}
__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь
0
void timer(){
float timePassMin = 0;
int timePassHalfHr = 0;
delay(mins * 0.5);
timePassMin = timePassMin + 0.5;
if (timePassMin = 30){
timePassMin = 0;
timePassHalfHr = timePassHalfHr + 1;
}
if (timePassHalfHr = 0){
flash(); // when NO half hours have passed blink the internal led (different function)
}
for (6 - timePassHalfHr){ //this line is getting error msg.
digitalWrite(ledin, HIGH); //ledin = 13, or built in led
delay(secs * 1); //secs = 1000 (global variable)
digitalWrite(ledin, LOW);
delay(secs * 0.6);
}
if (timePassHalfHr = 12){
exit; //goal is to only time 6 hours. "Exit" ends the function, right?
}
}
Goal of function is to time 6 hours when called, and for those 6 hours every 30 secs flash the internal led for the amount of half hours left.
Something is wrong with for loop, although there are semi collins after every line. Ideas? (Included whole function in case context is needed)







