Помогите решить проблему
- Войдите на сайт для отправки комментариев
Пнд, 22/01/2018 - 05:25
Нашел проект http://forum.arduino.cc/index.php?topic=62955.0
Но при компиляции выходит ошибка:
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:7:0: warning: "PROGMEM" redefined
#define PROGMEM
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:28:0,
from C:\Program Files (x86)\Arduino\libraries\phi_prompt/phi_prompt.h:69,
from C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1:
c:\program files (x86)\arduino\hardware\tools\avr\avr\include\avr\pgmspace.h:113:0: note: this is the location of the previous definition
#define PROGMEM __ATTR_PROGMEM__
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void setup()':
SMBusBattery_Phi:253: error: call of overloaded 'write(int)' is ambiguous
lcd.write(0); lcd.write(1); lcd.write(2); lcd.write(3);
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:253:14: note: candidates are:
In file included from C:\Program Files (x86)\Arduino\libraries\phi_prompt/phi_prompt.h:70:0,
from C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src/LiquidCrystal.h:83:18: note: virtual size_t LiquidCrystal::write(uint8_t)
virtual size_t write(uint8_t);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,
from C:\Program Files (x86)\Arduino\libraries\phi_prompt/phi_prompt.h:69,
from C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:52:12: note: size_t Print::write(const char*)
size_t write(const char *str) {
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void SelectCommand()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:405:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
if (commandMenu.low.i >= 0 && commandMenu.low.i <= (sizeof(cmdset_items) / sizeof(&cmdset_items))-1) {
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void DisplaySingleCommand()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:434:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR(" Ah"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:439:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR(" Amps"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:444:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR(" Volts"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:448:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR(" Minutes"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:452:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR("%"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:457:47: warning: null argument where non-null required (argument 2) [-Wnonnull]
strcpy_P(i2cBuffer+strcspn(i2cBuffer,0),PSTR(" F"));
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void ScanI2C()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:543:33: warning: deprecated conversion from string constant to 'char*' [-Wwrite-strings]
ok_dialog("No devices found");
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void DisplayChargeData()':
SMBusBattery_Phi:631: error: call of overloaded 'write(int)' is ambiguous
lcd.write(0); lcd.write(1);
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:631:14: note: candidates are:
In file included from C:\Program Files (x86)\Arduino\libraries\phi_prompt/phi_prompt.h:70:0,
from C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1:
C:\Program Files (x86)\Arduino\libraries\LiquidCrystal\src/LiquidCrystal.h:83:18: note: virtual size_t LiquidCrystal::write(uint8_t)
virtual size_t write(uint8_t);
^
In file included from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Stream.h:26:0,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/HardwareSerial.h:29,
from C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:232,
from C:\Program Files (x86)\Arduino\libraries\phi_prompt/phi_prompt.h:69,
from C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1:
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Print.h:52:12: note: size_t Print::write(const char*)
size_t write(const char *str) {
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void EnterI2C()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:30: warning: narrowing conversion of '(((((int)deviceAddress) >> 6) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:62: warning: narrowing conversion of '(((((int)deviceAddress) >> 5) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:94: warning: narrowing conversion of '(((((int)deviceAddress) >> 4) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:126: warning: narrowing conversion of '(((((int)deviceAddress) >> 3) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:158: warning: narrowing conversion of '(((((int)deviceAddress) >> 2) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:190: warning: narrowing conversion of '(((((int)deviceAddress) >> 1) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:712:222: warning: narrowing conversion of '((((int)deviceAddress) & 1) + 48)' from 'int' to 'char' inside { } [-Wnarrowing]
char textAddress[8] = {'0' + bitRead(deviceAddress,6), '0' + bitRead(deviceAddress,5), '0' + bitRead(deviceAddress,4), '0' + bitRead(deviceAddress,3), '0' + bitRead(deviceAddress,2), '0' + bitRead(deviceAddress,1), '0' + bitRead(deviceAddress,0)}; // This is the buffer that will store the content of the text panel.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void lcdPadBinary(uint8_t, uint8_t)':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:919:37: warning: return-statement with a value, in function returning 'void' [-fpermissive]
if (bits > 8) return lcd.write('E');
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void lcd_reinit_phi()':
SMBusBattery_Phi:1018: error: cannot convert 'phi_buttons**' to 'multiple_button_input**' for argument '2' to 'void init_phi_prompt(LiquidCrystal*, multiple_button_input**, char**, int, int, char)'
init_phi_prompt(&lcd,btns,lcd_columns, lcd_rows, '\x7e'); // Supply the liquid crystal object and the phi_buttons objecst. Also supply the column and row of the lcd, and indicator as '>'. You can also use '\x7e', which is a right arrow.
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'void lcdClearSpace(byte, byte, byte)':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:1051:9: warning: statement has no effect [-Wunused-value]
for (x;x<spaces;x++) lcd.write(' ');
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'uint8_t cmd_getCode(uint8_t)':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:167:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'uint8_t cmd_getType(uint8_t)':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:175:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'char** cmd_getPtr()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:190:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino: In function 'uint8_t cmd_getLength()':
C:\Users\PM\Documents\sketch_jan22b\SMBusBattery_Phi\SMBusBattery_Phi.ino:197:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
exit status 1
call of overloaded 'write(int)' is ambiguous
мошт, со светодиодика начать? И мелкими-мелкими перебежками -> к свету?
Может поможете скомпилировать правильно?)
Может поможете скомпилировать правильно?)
Неа.
Ругается на 1019 строке
Вот неужели всерьез думаешь, что кому то будет интересно копаться в этой портянке.
Мошт, аффтару налить? Он поможет
Но вроде код рабочий - просто не компилируется ! Кому налить?)
Автору кода.
volshebnik123. судя по некоторым #define вначале - это код для старых версий Ардуино ИДЕ. При выпуске новых версий в них часто появлются несовместимые изменения. поэтому компилировать старые проекты на свежих ИДЕ - это головная боль и гемор. Один из вариантов - это поставить на комп старую версию ИДЕ (примерно 1.0.х) и попытаться собрать в ней. Но не факт, что получится, потому что версий было много и лучше бы занать, под какой этот проект собирался.
А править код, чтобы убрать все ошибки в листинге более 1000 строк - это вряд ли хоть кто-то станет, кроме автора.