Error expected unqualified id before numeric constant ошибка

Проблема с написание программы на C++ выдаёт ошибку: expected unqualified-id before numeric constant. Что делать? #define TEPLO 1 #define vent 8 #define Vla A2 #define PIN_RELAY 7#define PIN_PHOTO_SENSOR A1#include LiquidCrystal lcd(4, 5, 10, 11, 12, 13);#include #include «DHT.h» #define DHTPIN A0 #define DHTTYPE DHT11 int val; int waterPump = 3; int PIN_RELAY = 4; […]

Содержание

  1. Проблема с написание программы на C++ выдаёт ошибку: expected unqualified-id before numeric constant. Что делать?
  2. Arduino.ru
  3. Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru
  4. forum.arduino.ru
  5. Что значит ошибка expected unqualified-id before numeric constant? Как её исправить?
  6. Ожидаемый unqualified-id перед числовой константой для определения числа
  7. 2 ответов
  8. C++:expected unqualified-id
  9. Re: C++:expected unqualified-id
  10. Re: C++:expected unqualified-id
  11. Re: C++:expected unqualified-id
  12. Re: C++:expected unqualified-id
  13. Re: C++:expected unqualified-id
  14. Re: C++:expected unqualified-id
  15. Re: C++:expected unqualified-id
  16. Re: C++:expected unqualified-id
  17. Re: C++:expected unqualified-id
  18. Re: C++:expected unqualified-id
  19. Re: C++:expected unqualified-id
  20. Re: C++:expected unqualified-id
  21. Re: C++:expected unqualified-id
  22. Re: C++:expected unqualified-id
  23. Re: C++:expected unqualified-id
  24. Re: C++:expected unqualified-id
  25. Re: C++:expected unqualified-id
  26. Re: C++:expected unqualified-id
  27. Re: C++:expected unqualified-id
  28. Re: C++:expected unqualified-id
  29. Re: C++:expected unqualified-id
  30. Re: C++:expected unqualified-id
  31. Re: C++:expected unqualified-id
  32. Re: C++:expected unqualified-id
  33. Re: C++:expected unqualified-id
  34. [offtopic] Про жизнь.
  35. Re: [offtopic] Про жизнь.
  36. Re: [offtopic] Про жизнь.
  37. Re: [offtopic] Про жизнь.

Проблема с написание программы на C++ выдаёт ошибку: expected unqualified-id before numeric constant. Что делать?

#define TEPLO 1
#define vent 8
#define Vla A2
#define PIN_RELAY 7
#define PIN_PHOTO_SENSOR A1
#include
LiquidCrystal lcd(4, 5, 10, 11, 12, 13);
#include
#include «DHT.h»
#define DHTPIN A0
#define DHTTYPE DHT11
int val;
int waterPump = 3;
int PIN_RELAY = 4;
int LE = 5;
int LEW = 6;
DHT dht(DHTPIN, DHTTYPE);
byte heart[8] = <
0b10101,
0b10101,
0b01110,
0b00100,
0b01110,
0b10101,
0b10101,
0b00000,
>;
byte H[8] = <
0b00100,
0b00100,
0b01010,
0b01010,
0b10001,
0b10001,
0b10001,
>;
byte A[8] = <
0b10001,
0b11011,
0b10101,
0b10001,
0b10001,
0b10001,
0b10001,
>;
byte Q[8] = <
0b11111,
0b10001,
0b10001,
0b10001,
0b10001,
0b10001,
0b10001,
>;

void setup() <
Serial.begin(9600);
pinMode(waterPump, OUTPUT);
digitalWrite(waterPump, LOW);
pinMode(PIN_RELAY, OUTPUT);
digitalWrite(PIN_RELAY, LOW);
pinMode(LE, OUTPUT);
digitalWrite(LE, LOW);
pinMode(LEW, OUTPUT);
digitalWrite(LEW, LOW);
<
pinMode(PIN_RELAY, OUTPUT);
>

dht.begin();
pinMode(3, OUTPUT);
delay(2000);
pinMode(waterPump, OUTPUT);
digitalWrite(PIN_RELAY, HIGH);
digitalWrite(TEPLO, HIGH);
>
void loop() <
delay(2000);
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);
lcd.createChar(1, heart);
lcd.createChar(2, H);
lcd.createChar(3, A);
lcd.createChar(4, Q);
lcd.begin(16, 2);
lcd.print(«B»);
lcd.print(char(2));
lcd.print(«A»);
lcd.print(char(1));
lcd.print(«H»);
lcd.setCursor(6, 0);
lcd.print(h, 1);
lcd.setCursor(12, 0);
lcd.print(«IT-8»);
lcd.setCursor(0, 1);
lcd.print(«T»);
lcd.print(«E»);
lcd.print(char(3));
lcd.print(char(4));
lcd.setCursor(5, 1);
lcd.print(t,1);
lcd.setCursor(10, 1);
lcd.print(«Nikita»);

<
if (analogRead (PIN_PHOTO_SENSOR) 30) digitalWrite(waterPump, LOW);
else digitalWrite(waterPump, HIGH);
>
delay(2000);
float h = dht.readHumidity();
float t = dht.readTemperature();
float f = dht.readTemperature(true);

if ((t) > 25) digitalWrite(TEPLO, HIGH);
else digitalWrite(TEPLO, LOW);
<
if ((t) Лучший ответ

sketch_apr29a:4: error: expected unqualified-id before numeric constant

Источник

Arduino.ru

Регистрация новых пользователей и создание новых тем теперь только на новом форуме https://forum.arduino.ru

forum.arduino.ru

Что значит ошибка expected unqualified-id before numeric constant? Как её исправить?

Код ошибки «Arduino: 1.8.13 (Windows 10), Плата:»Arduino Nano, ATmega328P (Old Bootloader)»

In file included from C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino:4:0:

C:Users����DocumentsArduinolibrariesTime-master/Time.h:1:2: warning: #warning «Please include TimeLib.h, not Time.h. Future versions will remove Time.h» [-Wcpp]

#warning «Please include TimeLib.h, not Time.h. Future versions will remove Time.h»

sketch_aug15a:9:11: error: expected unqualified-id before numeric constant

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino: In function ‘void setup()’:

sketch_aug15a:120:7: error: unable to find numeric literal operator ‘operator»»dig_display.init’

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino: In function ‘void loop()’:

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino:166:27: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

sketch_aug15a:195:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:197:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:199:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:201:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:203:10: error: unable to find numeric literal operator ‘operator»»dig_display.point’

expected unqualified-id before numeric constant

Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»»
Сам код:
#include
#include
#include
#include
#include «TM1637.h»
#define CLK 6
#define DIO 5

TM1637 4dig_display(CLK, DIO);

// для данных времени

// для данных dd/mm

// для смены время / день-месяц

unsigned long millist=0;

OLED myOLED(4, 3, 4); //OLED myOLED(SDA, SCL, 8);

extern uint8_t SmallFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];

///// часы ..
byte decToBcd(byte val) <
return ( (val/10*16) + (val%10) );
>

byte bcdToDec(byte val) <
return ( (val/16*10) + (val%16) );
>

void setDateDs1307(byte second, // 0-59
byte minute, // 0-59
byte hour, // 1-23
byte dayOfWeek, // 1-7
byte dayOfMonth, // 1-28/29/30/31
byte month, // 1-12
byte year) // 0-99
<
Wire.beginTransmission(0x68);
Wire.write(0);
Wire.write(decToBcd(second));
Wire.write(decToBcd(minute));
Wire.write(decToBcd(hour));
Wire.write(decToBcd(dayOfWeek));
Wire.write(decToBcd(dayOfMonth));
Wire.write(decToBcd(month));
Wire.write(decToBcd(year));
Wire.endTransmission();
>

void getDateDs1307(byte *second,
byte *minute,
byte *hour,
byte *dayOfWeek,
byte *dayOfMonth,
byte *month,
byte *year)
<

Wire.beginTransmission(0x68);
Wire.write(0);
Wire.endTransmission();

*second = bcdToDec(Wire.read() & 0x7f);
*minute = bcdToDec(Wire.read());
*hour = bcdToDec(Wire.read() & 0x3f);
*dayOfWeek = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month = bcdToDec(Wire.read());
*year = bcdToDec(Wire.read());
>

///// температура ..
float get3231Temp() <
byte tMSB, tLSB;
float temp3231;

Wire.beginTransmission(0x68);
Wire.write(0x11);
Wire.endTransmission();
Wire.requestFrom(0x68, 2);

if(Wire.available()) <
tMSB = Wire.read(); //2’s complement int portion
tLSB = Wire.read(); //fraction portion

temp3231 = (tMSB & B01111111); //do 2’s math on Tmsb
temp3231 += ( (tLSB >> 6) * 0.25 ); //only care about bits 7 & 8
>
else <
//oh noes, no data!
>

void setup()
<
Serial.begin(9600); // запустить последовательный порт

Serial.begin(9600);
myOLED.begin();
Wire.begin();

// установка часов
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
second = 30;
minute = 0;
hour = 14;
dayOfWeek = 3; // день недели
dayOfMonth = 1; // день
month = 4;
year = 14;

//setDateDs1307(00, 40, 15, 6, 15, 8, 2020);

char time[10];
char data[11];

snprintf(time, sizeof(time),»%02d:%02d:%02d»,
hour, minute, second);

snprintf(data, sizeof(data), «%02d/%02d/%02d»,
dayOfMonth, month, year);

Источник

Ожидаемый unqualified-id перед числовой константой для определения числа

Я новичок в C++, поэтому я не знаю, что они имеют в виду с этой ошибкой в Примере phidget-code:

Main.cpp: 8: 16: ошибка: ожидаемый неквалифицированный-id перед числовой константой

есть ли синтаксическая ошибка? Или что-то еще? Я использую #define вместо int.

EDIT: добавлен полный журнал ошибок..

2 ответов

вы пытаетесь объявить переменную с тем же именем, что и макрос, но это невозможно сделать. Препроцессор уже протоптал программу, превратив ее в string 1234; , что не является допустимым объявлением. Препроцессор не имеет знаний о структуре программы, а макросы не следуют правилам области действия языка.

по возможности используйте языковые функции, такие как константы и встроенные функции, а не макросы. В этом случае, вы можете использовать

это будет ограничено глобальным пространством имен и может быть безопасно скрыто чем-то с тем же именем в более узкой области. Даже когда он скрыт, он всегда доступен как ::homeid .

когда вам действительно нужен макрос, разумно следовать соглашению об использовании SHOUTY_CAPS для макросов. Помимо привлечения внимания к потенциальным опасностям и странностям, связанным с использованием макросов, он не будет конфликтовать с любым именем, используя другую капитализацию.

эта линия в порядке.

скорее всего, компилятор жалуется не на само определение макроса, а на использовать макро. Пример:

при компиляции этого с GCC я получаю:

Это говорит вам, что числовая константа, запрашивающая жалобу, является частью определения макроса, но также и что этот макрос используется (в данном случае, по-видимому, случайно) в строке 3. Брать посмотрите, откуда в вашем коде происходит расширение макроса.

Источник

C++:expected unqualified-id

Сегодня услышал, что в терминах С++ структура похожа на класс, и может иметь конструкторыдеструкторы. Попробовал:
struct some_struct_in_memory<

Получаю от gcc:
error: expected unqualified-id before «void»
error: expected `)’ before «void»

Что это такое и как с этим бороться?

Re: C++:expected unqualified-id

Либо помести обьявление внутрь обьявления структуры, либо обьяви

Re: C++:expected unqualified-id

С классом у тебя то же самое было бы.

так нужно писать только внутри объявления структуры.

А вне ее нужно писать

Re: C++:expected unqualified-id

Структура не просто похожа на класс. Это и есть класс с единтсвенным отличием: доступ по умолчанию public.

Re: C++:expected unqualified-id

Спасибо всем большое!

Re: C++:expected unqualified-id

>Сегодня услышал, что в терминах С++ структура похожа на класс, и может иметь конструкторыдеструкторы.

Тогда это будет не структура а класс с дефолтным public доступом и дефолтным public наследованием. Если есть желание сохранить хоть немного единообразия в С++ проекте используй везде class, а struct делай в стиле Си для интероперабельности с Си кодом.

Re: C++:expected unqualified-id

>Спасибо всем большое!

Они все дали неправильные ответы.

Re: C++:expected unqualified-id

> Они все дали неправильные ответы.

не неправильные, а идеологически невыдержанные

Re: C++:expected unqualified-id

Почему неверные? То что структура С++ задумывалось для совместимости не маешает ей быть классом.

Re: C++:expected unqualified-id

>Почему неверные? То что структура С++ задумывалось для совместимости

Для совместимости с чем? Если она не POD, то она не совместимая

>не маешает ей быть классом

А какой смысл дублировать сущность? Неужели ради того чтобы один раз public не написать?

Re: C++:expected unqualified-id

На сколько я понимаю введено для совместимости c сишными структурами.

Re: C++:expected unqualified-id

Так что же неверно в выше написаном?

Re: C++:expected unqualified-id

Дело в том, что эта структура пишется в заmmapенную память, которая позже скидывается на диск. Эта структура — суперблок, так что мне бы не хотелось засорять плюсовыми прибамбасами образ диска 🙂

Re: C++:expected unqualified-id

>На сколько я понимаю введено для совместимости c сишными структурами.

Структура с конструктором/деструктором по С++ стандарту Plain Old Data (POD) не является и с сишными структурами может быть совместима только случайно.

Re: C++:expected unqualified-id

>Дело в том, что эта структура пишется в заmmapенную память, которая позже скидывается на диск. Эта структура — суперблок, так что мне бы не хотелось засорять плюсовыми прибамбасами образ диска 🙂

Делай методы init()/destroy(). У POD могут быть невиртуальные методы.

Re: C++:expected unqualified-id

значит без пользовательского ктора надо. Иначе она уже не под.

Re: C++:expected unqualified-id

> Структура с конструктором/деструктором по С++ стандарту Plain Old Data (POD) не является и с сишными структурами может быть совместима только случайно.

уточнение: если конструктор без деструктора, то POD:

A POD-struct is an aggregate class that has no non-static data members of type pointer to member, non-POD-struct, non-POD-union (or array of such types) or reference, and has no user-defined copy assignment operator and no user-defined destructor.

Re: C++:expected unqualified-id

> Дело в том, что эта структура пишется в заmmapенную память, которая позже
> скидывается на диск. Эта структура — суперблок,

А вот за это пороть нужно. Что будет, если такую чудо-ФС перенесут с 32-битной
машины на 64-битную? С little endian машины на big endian?

Re: C++:expected unqualified-id

Простите меня заранее. Пишется оно под 64 бита. Под встраиваемую операционку, которая _никогда_ не будет перенесена.

Re: C++:expected unqualified-id

>которая _никогда_ не будет перенесена.

так все говорят, а потом приходит тот кто платит деньги, и говорю а я хочу вот это..

Re: C++:expected unqualified-id

Она делается как очень специализированная оська для очень специфических целей. Простите за возможный понт (просто мне очень повезло), но платит большая-пребольшая фирма, которая заранее знает, чего хочет.

Re: C++:expected unqualified-id

> Пишется оно под 64 бита. Под встраиваемую операционку, которая _никогда_
> не будет перенесена.

Перенос ОС != перенос файловой системы. Вы точно уверены, что никто не захочет
подмонтировать и/или создать образ ФС на PC’юке (или ещё какой-нибудь
архитектуре)?

Re: C++:expected unqualified-id

Хоть и не мне было адресовано, но я всё же отвечу.

> Простите за возможный понт (просто мне очень повезло), но платит
> большая-пребольшая фирма, которая заранее знает, чего хочет.

Ничего страшного. Зато мы получили ещё одну возможность полюбоваться
на качество проприетарного кода.

Re: C++:expected unqualified-id

Работает принцип: «Мы можем сделать быстро, качественно, дёшево. Выберете два из этих трёх.» Чаще всего выбирают быстро и потом так никак и не могут определиться качественно или дёшево.

Re: C++:expected unqualified-id

Я все понимаю. Я _не_ программист на плюсах, и вопрос был детским. К тому же, я еще не спец, но весь код проверяется и «руководится». И мне почему-то кажется, что Вы тоже родились без талмудов Кнута в руках. Все учатся, я тоже, и вы тоже наверняка задавали глупые вопросы, не на форумах, так старшим по мозгам. Вполне естественно, что крупные фирмы берут к себе студентов интернами, а через несколько лет — на полноценную инженерную работу.
Честное слово, я ни на кого не наезжаю — я вам всем очень благодарен за ответы и ваш опыт. Особенно товарищу dilmah, который уже много раз меня спасал в сложных ситуациях.

Re: C++:expected unqualified-id

> Она делается как очень специализированная оська для очень специфических целей.

А что за железяка-то, которой она рулить будет? Интересуюсь для того, чтоб не купить её ненароком.

[offtopic] Про жизнь.

> И мне почему-то кажется, что Вы тоже родились без талмудов Кнута в руках.

Я не лез программировать ФС, да ещё и для встраиваемой ОСи. Да ещё и для production.

> Все учатся, я тоже, и вы тоже наверняка задавали глупые вопросы, не на форумах, так старшим по мозгам.

И не удивлялся, если получал в ответ втык (в том числе — и в буквальном смысле слова).

> Вполне естественно, что крупные фирмы берут к себе студентов интернами, а через несколько лет — на полноценную инженерную работу.

Ни разу это не естественно. Одновременно работать и учиться НЕ ВЫЙДЕТ. В результате и имеем таких «спецов». Как подумаю, что такие же рулят ядерными электростанциями, или лечат людей, жить страшно становится.

> Честное слово, я ни на кого не наезжаю

Я тоже. Только после общения с очередной кривой железкой очень хочется найти того, кто писал прошивку, или разводил печатную плату, etc, и как следует поблагодарить.

И вот я захожу на LOR, и вижу процесс появления такого изделия в реальном масштабе времени, так сказать.

Re: [offtopic] Про жизнь.

>Я не лез программировать ФС, да ещё и для встраиваемой ОСи.
Ну да, все начинали со змейки. Главное — ей не закончить. А для этого надо заниматься чем-то посложнее.

>Да ещё и для production.
Это еще не продакшн. Это прототип. Пруф оф концепт (с). А если оно выйдет в продакшн, но довольно нескоро.

>Одновременно работать и учиться НЕ ВЫЙДЕТ.
Сами же понимаете, что практический опыт в таких узких областях ценнее теории. Хотя здесь есть и теоретическое обучение.

>и как следует поблагодарить
Если через 4 года оно выйдет и вам не понравится — с меня ящик пива. Честно.

Re: [offtopic] Про жизнь.

> Ну да, все начинали со змейки.

Не, я начинал с падающего шарика (требовалось рассчитать траекторию падения с учётом сопротивления воздуха).

> Главное — ей не закончить.

Да некоторым (это не про Вас) лучше было бы на ней и закончить.

> Если через 4 года оно выйдет и вам не понравится — с меня ящик пива. Честно.

Слабое утешение, тем более, что я не употребяю.

Re: [offtopic] Про жизнь.

Все будет хорошо. Если весьма своеобразное высшее руководство не забросит офигенную идею. А такое уже не раз бывало 🙁

Источник

Marmazetka

20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

1

07.03.2016, 19:29. Показов 6228. Ответов 14

Метки нет (Все метки)


Ну значит так.Простенькая программа просто что бы научиться. Имеется форма созданная с помощью конструктора ResEd. Компилятор CodeBlock.Я смотрел такой метод на каком-то сайте. Так вот сама программа:

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include <iostream>
#include "celsius.h"
#include <cstdlib>
 
using namespace std;
 
double Fahrenheit(int);
double Fahrenheit(int a)
{
    return a*1.8+32;
}
int a = System::Convert::ToDouble(n->Text);
double b = Fahrenheit(a);
ot->Text = System::Convert::ToString(Fahrenheit(a));

Как видно она подключает мою форму #include «celsius.h». Он выдает ошибку error: expected unqualified-id before numeric constant на 6 строчку файла с формой:

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#define celsius 1234
#define n 1001
#define z 1002
#define ot 1005
 
celsius DIALOGEX -4,-16,295,208,1234 // Вот сюда ошибка...
CAPTION "Celsius" 
FONT 8,"MS Sans Serif",0,0,0
STYLE WS_VISIBLE|WS_CAPTION|WS_SYSMENU|WS_THICKFRAME|WS_MINIMIZEBOX|DS_ABSALIGN
EXSTYLE WS_EX_TRANSPARENT
BEGIN
  CONTROL "",n,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_NUMBER|ES_CENTER,9,3,81,24,WS_EX_CLIENTEDGE
  CONTROL "z",z,"Button",WS_CHILD|WS_VISIBLE|WS_TABSTOP,108,9,39,18
  CONTROL "",ot,"Edit",WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_NUMBER|ES_MULTILINE,171,15,81,24,WS_EX_CLIENTEDGE
END

Вот просидел весь день так и не нашел ничего в интернете, И сам ничего не смог сделать, помогите разобраться)

__________________
Помощь в написании контрольных, курсовых и дипломных работ, диссертаций здесь



0



es geht mir gut

11264 / 4746 / 1183

Регистрация: 27.07.2011

Сообщений: 11,437

07.03.2016, 19:44

2

celsius зачем нужен?



0



Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 19:50

3

«celsius.h» — это файл ресурсов, а не код на С++.
Его надо переименовать в celsius.rc и подключить к проекту как файл ресурсов.



0



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 20:07

 [ТС]

4

Добавлено через 3 минуты

Цитата
Сообщение от SoftIce
Посмотреть сообщение

celsius зачем нужен?

Ты имеешь ввиду в 6 строчке?

Добавлено через 2 минуты

Цитата
Сообщение от zss
Посмотреть сообщение

«celsius.h» — это файл ресурсов, а не код на С++.
Его надо переименовать в celsius.rc и подключить к проекту как файл ресурсов.

Дело в том что у меня из начально так и было (celsius.rc) Потом полазив в интернете нашел что то такое и решил переименовать. Ошибка та же была. Единственное что, если это делается по-другому: Как подключить к проекту как файл ресурсов его?



0



Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 20:09

5

В Visual Studio
Команда Меню
Проект->Добавить существующий элемент.
Или правой кнопкой мыши в обозревателе решения->Добавить существующий элемент



1



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 20:29

 [ТС]

6

Цитата
Сообщение от zss
Посмотреть сообщение

В Visual Studio
Команда Меню
Проект->Добавить существующий элемент.
Или правой кнопкой мыши в обозревателе решения->Добавить существующий элемент

Похоже что у меня какая-та проблема с Code Block, ибо он никак не реагирует на нажатие Add Files. Надо переустановить. Спасибо)



0



Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 21:11

7

Цитата
Сообщение от Marmazetka
Посмотреть сообщение

ибо он никак не реагирует на нажатие Add Files

А Вы проект-то создавали?
Подозреваю, что Вы просто открыли CPP файл.



0



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 21:15

 [ТС]

8

Цитата
Сообщение от zss
Посмотреть сообщение

А Вы проект-то создавали?
Подозреваю, что Вы просто открыли CPP файл.

Ну у меня он до этого создан был потом, я решил попробовать свою программку в форму запихать… Или надо совсем заново создавать?



0



Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 21:24

9

Создайте пустой новый проект и добавьте в него оба файла.
Только я не пойму, какой тип приложения надо создать.
У Вас неполный код. Думаю, что это Windows приложение.
Тогда точкой входа должна быть функция WinMain, в которой Вы открываете вышеописанный диалог celsius.

Добавлено через 2 минуты
Но откуда взят этот кусок:

Цитата
Сообщение от Marmazetka
Посмотреть сообщение

int a = System::Convert::ToDouble(n->Text);
double b = Fahrenheit(a);
ot->Text = System::Convert::ToString(Fahrenheit(a));

я не понимаю, это похоже какой-то фрагмент из Windows Form CLI.



1



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 21:28

 [ТС]

10

Хорошо, сейчас попробую…

Добавлено через 2 минуты
Я рассматривал такой пример на каком то сайте. Там был такой вот код, я его изменил под свою программку

Цитата
Сообщение от zss
Посмотреть сообщение

Но откуда взят этот кусок:
Сообщение от Marmazetka
int a = System::Convert::ToDouble(n->Text);
double b = Fahrenheit(a);
ot->Text = System::Convert::ToString(Fahrenheit(a));
я не понимаю, это похоже какой-то фрагмент из Windows Form CLI

Добавлено через 1 минуту
Могу дать ссылку… Если это не запрещено

Цитата
Сообщение от zss
Посмотреть сообщение

Но откуда взят этот кусок:



0



Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 21:30

11

Я имел ввиду, что этот кусок должен быть частью функции, приведите ее код.



0



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 21:53

 [ТС]

12

Ну как понял он должен быть внутри функции WinMain.

Цитата
Сообщение от zss
Посмотреть сообщение

Я имел ввиду, что этот кусок должен быть частью функции, приведите ее код.

Создал я проект win32 GUI кинул два файла в итоге там первоначальный код. Там уже есть WinMain только она заполнена. Только вот это похоже на то что я смотрел в видео о создании простого оконного приложения. Тогда куда мне код мой девать в этом всем?



0



Эксперт С++

8719 / 4299 / 958

Регистрация: 15.11.2014

Сообщений: 9,744

07.03.2016, 22:23

13

Цитата
Сообщение от zss
Посмотреть сообщение

В Visual Studio

Цитата
Сообщение от Marmazetka
Посмотреть сообщение

Code Block

Цитата
Сообщение от Marmazetka
Посмотреть сообщение

Дело в том что у меня из начально так и было (celsius.rc)

файл ресурсов вижуал студии.

и почему это у нас в подводной лодке не работает запчасть от самолета?



0



zss

Модератор

Эксперт С++

12641 / 10135 / 6102

Регистрация: 18.12.2011

Сообщений: 27,170

07.03.2016, 22:30

14

Лучший ответ Сообщение было отмечено Marmazetka как решение

Решение

CONTROL «»,n,»Edit»,WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_NUMB ER|ES_CENTER,9,3,81,24,WS_EX_CLIENTEDGE
CONTROL «z»,z,»Button»,WS_CHILD|WS_VISIBLE|WS_TABSTOP,108, 9,39,18
CONTROL «»,ot,»Edit»,WS_CHILD|WS_VISIBLE|WS_TABSTOP|ES_NUM BER|ES_MULTILINE,171,15,81,24,WS_EX_CLIENTEDGE

Редактируемое поле n — это похоже число, которое надо перевести, а поле on предназначено для вывода.
Кнопка z — Для выполнения вычисления.
Тогда у Вас .cpp файл должен быть примерно такой

C++
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
#include <windows.h>
#define celsius 1234
#define n 1001
#define z 1002
#define ot 1005
double Fahrenheit(int a)
{
    return a*1.8+32;
}
int WINAPI fn(HWND hwnd,int cmd,WPARAM wp,LPARAM lp)
{
    switch(cmd)
    {
 
    case WM_INITDIALOG:
          SetDlgItemInt(hwnd,n,99,false);   
        return 1;
    case WM_CLOSE:
        EndDialog(hwnd,1);
        return 1;
    case WM_SIZE:
        InvalidateRect(hwnd,NULL,TRUE);
        return 1;
    case WM_COMMAND:
        switch (LOWORD(wp))
        {
        case n:
                    {
                       char txt[100];
                       GetDlgItemText(hwnd,n,txt);
                       double a;
                       sscanf(txt,"%lf",&a);
                       double b = Fahrenheit(a);
                       sprintf(txt,"%lf",b);
                       SetDlgItemText(hwnd,ot,txt);
                    }
            return 1;
        }
        return 0;
        case WM_PAINT:
            {
                PAINTSTRUCT ps;
                HDC hdc = BeginPaint(hwnd, &ps);
                
                EndPaint(hwnd, &ps);
            }
            return 1;
    }
    return 0;
}
int WINAPI WinMain(HINSTANCE hi,HINSTANCE,LPSTR,int) 
{
    return DialogBox(hi,(LPCWSTR)z,NULL,(DLGPROC)fn);
}



1



20 / 16 / 8

Регистрация: 07.03.2016

Сообщений: 143

07.03.2016, 22:41

 [ТС]

15

Спасибо большое) Теперь синтаксическая ошибка но с ней я попробую справиться)



0



  • Forum
  • General C++ Programming
  • expected unqualified-id before numeric c

expected unqualified-id before numeric constant

What could be the source of this compilation error?


mathconst.hpp:2:14: error: expected unqualified-id before numeric constant
 const double M_PI   = 3.14159265358979323846;
               ^

This definition seems innocuous to me and the line is part of a math constant definition file included in a C++ library that compiles without trouble under Windows VC++17 and Linux g++/c++17.

The error however comes during a GCC compilation controlled by Cython. Cython is a tool to wrap C/C++ code so that it can interface with a Python interpreter. Cython generates the wrapping code and sends it to GCC. It is a bit of a black box to me so I am not sure why I am getting an error now.

Here is the GCC call:


gcc -pthread -Wno-unused-result -Wsign-compare -DDYNAMIC_ANNOTATIONS_ENABLED=1 
-DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector 
--param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC 
-I/usr/include/python3.6m -c PyLidar.cpp -o build/temp.linux-x86_64-3.6/PyLidar.o 
-std=c++17

Last edited on

I suspect M_PI is already defined somewhere else, as a macro.

Yes, that’s exactly what I found.
It is defined in <cmath>. Previously I had #define _USE_MATH_DEFINE in my code to get those definitions but that doesn’t work in Visual Studio. So to make my code portable I had remove the #define _USE_MATH_DEFINE and instead created this const definition file. For some reason, however the macros contunue to be defined; not sure why.

How about:

1
2
3
4
5
6
7
#include <cmath>

#ifdef M_PI
#undef M_PI
#endif

const double M_PI   = 3.14159265358979323846;

but that doesn’t work in Visual Studio

It works just fine in VS. The problem is when the #define is encountered, which is often before you think it is.

Make sure that the very first line of your file, before any #includes, says #define _USE_MATH_DEFINES (note the ‘S’ on the end of that).

Unless you specify a specific standard, compilers will tend to include the math defines like M_PI. By providing the #define you override the standards-compliant behavior caused by -std=c++17. I suspect your invocation of cl did not specify a specific standard, and so it was not an issue.

Hope this helps.

Topic archived. No new replies allowed.

Arduino.ru

Что значит ошибка expected unqualified-id before numeric constant? Как её исправить?

  • Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

Код ошибки «Arduino: 1.8.13 (Windows 10), Плата:»Arduino Nano, ATmega328P (Old Bootloader)»

In file included from C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino:4:0:

C:Users����DocumentsArduinolibrariesTime-master/Time.h:1:2: warning: #warning «Please include TimeLib.h, not Time.h. Future versions will remove Time.h» [-Wcpp]

#warning «Please include TimeLib.h, not Time.h. Future versions will remove Time.h»

sketch_aug15a:9:11: error: expected unqualified-id before numeric constant

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino: In function ‘void setup()’:

sketch_aug15a:120:7: error: unable to find numeric literal operator ‘operator»»dig_display.init’

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino: In function ‘void loop()’:

C:UsersПенёкDocumentsArduinosketch_aug15asketch_aug15a.ino:166:27: warning: ISO C++ forbids converting a string constant to ‘char*’ [-Wwrite-strings]

sketch_aug15a:195:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:197:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:199:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:201:10: error: unable to find numeric literal operator ‘operator»»dig_display.display’

sketch_aug15a:203:10: error: unable to find numeric literal operator ‘operator»»dig_display.point’

expected unqualified-id before numeric constant

Этот отчёт будет иметь больше информации с
включенной опцией Файл -> Настройки ->
«Показать подробный вывод во время компиляции»»
Сам код:
#include
#include
#include
#include
#include «TM1637.h»
#define CLK 6
#define DIO 5

TM1637 4dig_display(CLK, DIO);

// для данных времени

// для данных dd/mm

// для смены время / день-месяц

unsigned long millist=0;

OLED myOLED(4, 3, 4); //OLED myOLED(SDA, SCL, 8);

extern uint8_t SmallFont[];
extern uint8_t MediumNumbers[];
extern uint8_t BigNumbers[];

///// часы ..
byte decToBcd(byte val) <
return ( (val/10*16) + (val%10) );
>

byte bcdToDec(byte val) <
return ( (val/16*10) + (val%16) );
>

void setDateDs1307(byte second, // 0-59
byte minute, // 0-59
byte hour, // 1-23
byte dayOfWeek, // 1-7
byte dayOfMonth, // 1-28/29/30/31
byte month, // 1-12
byte year) // 0-99
<
Wire.beginTransmission(0x68);
Wire.write(0);
Wire.write(decToBcd(second));
Wire.write(decToBcd(minute));
Wire.write(decToBcd(hour));
Wire.write(decToBcd(dayOfWeek));
Wire.write(decToBcd(dayOfMonth));
Wire.write(decToBcd(month));
Wire.write(decToBcd(year));
Wire.endTransmission();
>

void getDateDs1307(byte *second,
byte *minute,
byte *hour,
byte *dayOfWeek,
byte *dayOfMonth,
byte *month,
byte *year)
<

Wire.beginTransmission(0x68);
Wire.write(0);
Wire.endTransmission();

*second = bcdToDec(Wire.read() & 0x7f);
*minute = bcdToDec(Wire.read());
*hour = bcdToDec(Wire.read() & 0x3f);
*dayOfWeek = bcdToDec(Wire.read());
*dayOfMonth = bcdToDec(Wire.read());
*month = bcdToDec(Wire.read());
*year = bcdToDec(Wire.read());
>

///// температура ..
float get3231Temp() <
byte tMSB, tLSB;
float temp3231;

Wire.beginTransmission(0x68);
Wire.write(0x11);
Wire.endTransmission();
Wire.requestFrom(0x68, 2);

if(Wire.available()) <
tMSB = Wire.read(); //2’s complement int portion
tLSB = Wire.read(); //fraction portion

temp3231 = (tMSB & B01111111); //do 2’s math on Tmsb
temp3231 += ( (tLSB >> 6) * 0.25 ); //only care about bits 7 & 8
>
else <
//oh noes, no data!
>

void setup()
<
Serial.begin(9600); // запустить последовательный порт

Serial.begin(9600);
myOLED.begin();
Wire.begin();

// установка часов
byte second, minute, hour, dayOfWeek, dayOfMonth, month, year;
second = 30;
minute = 0;
hour = 14;
dayOfWeek = 3; // день недели
dayOfMonth = 1; // день
month = 4;
year = 14;

//setDateDs1307(00, 40, 15, 6, 15, 8, 2020);

char time[10];
char data[11];

snprintf(time, sizeof(time),»%02d:%02d:%02d»,
hour, minute, second);

snprintf(data, sizeof(data), «%02d/%02d/%02d»,
dayOfMonth, month, year);

Источник

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.

(c) 2009 – Vince Thompson

Like this:

This entry was posted on June 5, 2009 at 3:54 pm and is filed under Arduino. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

2 Responses to “Correcting Arduino Compiler Errors”

[…] Robotics Lab Bringing Robotics Home « Microcontrollers as Time Keepers Correcting Arduino Compiler Errors […]

Nice, thank you.
The “stray ‘’ in program” error can also occurs if there’s an accent (like è) in the name of a function.

Источник

Arduino.ru

exit status 1 Error compiling for board Arduino/Genuino Uno.

  • Войдите или зарегистрируйтесь, чтобы получить возможность отправлять комментарии

можно задать ворос что произашло при загрузки програми которая работала день назад видает теперь

exit status 1
Error compiling for board Arduino/Genuino Uno.

вот все что мне написал компилятор
D:arduino-nightlylibrariesDS1307/DS1307.h:54:17: error: expected identifier before numeric constant

#define SUNDAY 7

D:arduino-nightlylibrariesDS1307/DS1307.h:54:17: error: expected ‘>’ before numeric constant

D:arduino-nightlylibrariesDS1307/DS1307.h:54:17: error: expected unqualified-id before numeric constant

In file included from C:UsersdimaDesktopfinalsketch_nov05asketch_nov05a.ino:4:0:

c:usersdimaappdatalocalarduino15packagesarduinotoolsavr-gcc4.9.2-atmel3.5.3-arduino2avrincludetime.h:506:1: error: expected declaration before ‘>’ token

Using library DHT-sensor-library-master at version 1.2.3 in folder: D:arduino-nightlylibrariesDHT-sensor-library-master
Використання бібліотеки LedControlMS з теки: D:arduino-nightlylibrariesLedControlMS (legacy)
Використання бібліотеки DS1307 з теки: D:arduino-nightlylibrariesDS1307 (legacy)
Using library Wire at version 1.0 in folder: C:UsersdimaAppDataLocalArduino15packagesarduinohardwareavr1.6.14librariesWire
Using library Adafruit-BMP085-Library-master at version 1.0.0 in folder: D:arduino-nightlylibrariesAdafruit-BMP085-Library-master
exit status 1
Error compiling for board Arduino/Genuino Uno.

Источник

  1. Не работает код для 3-х кнопок и 3-х светодиодов. Выдает:
    Arduino: 1.8.2 (Windows 7), Плата:»Arduino/Genuino Uno»

    In file included from C:Program Files (x86)Arduinohardwarearduinoavrcoresarduino/Arduino.h:32:0,

    from sketchsketch_jan18a.ino.cpp:1:

    C:Program Files (x86)Arduinohardwarearduinoavrcoresarduino/binary.h:31:12: error: expected unqualified-id before numeric constant

    #define B1 1

    ^

    C:UsersЕленаDesktopsketch_jan18asketch_jan18a.ino:4:11: note: in expansion of macro ‘B1’

    exit status 1
    Ошибка компиляции для платы Arduino/Genuino Uno.

    Этот отчёт будет иметь больше информации с
    включенной опцией Файл -> Настройки ->
    «Показать подробный вывод во время компиляции»

    А вот код (на всяк случ):

    const int L1 = 9;
    const int L2 = 10;
    const int L3 = 11;
    const int B1 = 2;
    const int B2 = 3;
    const int B3 = 4;

    void setup()
    {
    pinMode(L1, OUTPUT);
    pinMode(L2, OUTPUT);
    pinMode(L3, OUTPUT);
    pinMode(B1, INPUT);
    pinMode(B2, INPUT);
    pinMode(B3, INPUT);
    }

    void loop()
    {
    if (digitalRead(B1) == LOW)
    {
    digitalWrite(L1, LOW);
    }
    else
    {
    digitalWrite(L1, HIGH);
    }
    if (digitalRead(B2) == LOW)
    {
    digitalWrite(L2, LOW);
    }
    else
    {
    digitalWrite(L2, HIGH);
    }
    if (digitalRead(B3) == LOW)
    {
    digitalWrite(L3, LOW);
    }
    else
    {
    digitalWrite(L3, HIGH);
    }
    }
    Причем любой другой код без проблем грузит. Закон подлости или что-то другое?

  2. 1. Вставьте код правильно (кнопка «<>» на панели редактора);
    2. Приведите полный код — в том, что вы привели, нет ни одного #define, на который ругается.

  3. Это полный код. Не в коде ошибка, а ошибка КОМПИЛЯЦИИ.

  4. Понял в чём дело. Дайте другие имена переменным, ибо B1 — это в binary.h определение для двоичного представления числа 1. Короче, B1 как имя переменной — лучше не юзать.


    arkadyf и ИгорьК нравится это.

  5. Более того, вообще любые имена переменных, состоящие только из заглавных букв и цифр — лучше не юзать. Такие имена принято использовать для макросов препроцессора.
    Так что советую во всех ваших переменных заменить большие буквы маленькими…


    arkadyf и ИгорьК нравится это.

  6. Программа загрузилась, спасибо. А вот работает как-то странно. По идее, светодиоды должны включаться и выключаться нажатием соответствующих кнопок, а они просто мигают.

  7. Если не используете внешнюю подтяжку, включите внутреннюю

    pinMode(B1, INPUT_PULLUP);
    pinMode(B2, INPUT_PULLUP);
    pinMode(B3, INPUT_PULLUP);

    http://wiki.amperka.ru/конспект-arduino:кнопка

  8. козляра даже не знает, что названия городов пишутся с большой букы))))

  9. не используй капслок.
    Смотри на даты сообщений, когда отвечаешь.

Понравилась статья? Поделить с друзьями:
  • Error expected to return a value at the end of arrow function consistent return
  • Error expected string or bytes like object
  • Error expected specifier qualifier list before static
  • Error expected property shorthand object shorthand
  • Error expected primary expression before unsigned