Arduino: 1.8.5 (Windows 10), Плата:"Arduino/Genuino Uno" In file included from - вопрос №2864554

C:\Users\User1\Desktop\radio_tester\radio_tester.ino:3:0: C:\Users\User1\Documents\Arduino\libraries\BMP180_driver-master/bmp180.h:267:22: error: conflicting declaration 'typedef unsigned int u32' typedef unsigned int u32;/**< used for unsigned 32bit */ ^ In file included from C:\Users\User1\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino/Arduino.h:233:0, from sketch\radio_tester.ino.cpp:1: C:\Users\User1\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.6.21\cores\arduino/USBAPI.h:31:23: note: previous declaration as 'typedef long unsigned int u32' typedef unsigned long u32; ^ C:\Users\User1\Desktop\radio_tester\radio_tester.ino: In function 'void setup()': radio_tester:75: error: 'sensor' was not declared in this scope sensor.begin(); ^ C:\Users\User1\Desktop\radio_tester\radio_tester.ino: In function 'void loop()': radio_tester:89: error: 'sensor' was not declared in this scope if(sensor.read()) { ^ Несколько библиотек найдено для «VB_BMP180.h» Используется: C:\Users\User1\Documents\Arduino\libraries\VoltBroSensors-master Не используется: C:\Program Files (x86)\Arduino\libraries\Sensors Не используется: C:\Program Files (x86)\Arduino\libraries\Sensors Не используется: C:\Program Files (x86)\Arduino\libraries\Sensors Не используется: C:\Program Files (x86)\Arduino\libraries\Sensors Несколько библиотек найдено для «SD.h» Используется: C:\Users\User1\Documents\Arduino\libraries\SD Не используется: C:\Program Files (x86)\Arduino\libraries\SD exit status 1 'sensor' was not declared in this scope Этот отчёт будет иметь больше информации с включенной опцией Файл -> Настройки -> «Показать подробный вывод во время компиляции» ВОТ КОД: #include #include #include #include #include #include #include #include /* IMPORTANT NOTICE: The transmitter and the receiver must be set to the same channel! Don't forget to configure the receiver! SD card usage:.The circuit: * SD card attached to SPI bus as follows: ** MOSI — pin MOSI ** MISO — pin MISO ** CLK — pin CLK ** CS — pin 4 */ #include #include #include #include const int chipSelect = 4; const unsigned int Set = 5, CS = 6; //Set the settings and power pins /************* * CHANNELS: * * * * 01 * * 11 * * 21 * * 31 * *************/ const byte Channel = 0x01; //Insert your channel here^ void setup() { pinMode (Set, OUTPUT); pinMode (CS, OUTPUT); Serial.begin (9600); //Initialize connection to the radio module digitalWrite (CS, HIGH); //Turn on the radio module configurerf (Channel); //Configure the radio module // Open serial communications for debug: Serial.begin(9600); pinMode (13,OUTPUT); digitalWrite(13,HIGH); Serial.print(«Initializing SD card...»); // see if the card is present and can be initialized: if (!SD.begin(chipSelect)) { Serial.println(«Card failed, or not present»); // don't do anything more: return; } Serial.println(«card initialized.»); Serial.println («Hello!»); // Send a «Hello!» string to the receiver // delay(1000); // pressure sensor heating timeout sensor.begin(); } void loop() { // make a string for assembling the data to log: String dataString = ""; // read three sensors and append to the string: for (int analogPin = 0; analogPin < 2; analogPin++) { int sensorv = analogRead(analogPin); dataString += String(sensorv); dataString += ","; } if(sensor.read()) { dataString += String(sensor.alti); } else { dataString += "-no altitude-"; } Serial.println(dataString); // open the file. note that only one file can be open at a time, // so you have to close this one before opening another. File dataFile = SD.open(«datalog.txt», FILE_WRITE); // if the file is available, write to it: if (dataFile) { dataFile.println(dataString); dataFile.close(); // print to the serial port too: Serial.println(dataString); } // if the file isn't open, pop up an error: else { Serial.println(«error opening datalog.txt»); } delay (10); //Pause the program for 10 milliseconds } void configurerf (byte channel) { byte settings [17] = {0xAA,0xFA,0x03,0x14,0x01,0x03,0x07,0x03,0x02,0x01,0x01,0x00,0x00,0x00,0x00,0x00,0x00}; //The settings array settings [4] = channel; //Set the frequency digitalWrite (Set, LOW); //Set the module to configure mode Serial.write (settings, 17); //Configure the module digitalWrite (Set, HIGH); //Exit the configure mode } ЧТО ДЕЛАТЬ!!!???
Ответов пока нет
Посмотреть всех экспертов из раздела Технологии > C/C++
Пользуйтесь нашим приложением Доступно на Google Play Загрузите в App Store