Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't compile sketch for mega 2560 #23

Open
cind12 opened this issue Dec 12, 2022 · 1 comment
Open

Can't compile sketch for mega 2560 #23

cind12 opened this issue Dec 12, 2022 · 1 comment

Comments

@cind12
Copy link

cind12 commented Dec 12, 2022

Hi i have some problems with the sketh for arduino mega 2560
The Library is added and still no luck of compiling the sketh
thats the log from IDE

In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'void i2c_wait_scl_high()':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:250:35: error: 'SCL_PORT' was not declared in this scope
#define SCL_IN (_SFR_IO_ADDR(SCL_PORT) - 2)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:291:23: note: in expansion of macro 'SCL_IN'
: : [SCLIN] "I" (SCL_IN), [SCLPIN] "I" (SCL_PIN));
^~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:291:46: error: 'SCL_PIN' was not declared in this scope
: : [SCLIN] "I" (SCL_IN), [SCLPIN] "I" (SCL_PIN));
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'bool i2c_init()':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:246:39: error: 'SCL_PORT' was not declared in this scope
#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:398:23: note: in expansion of macro 'SCL_DDR'
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:398:47: error: 'SCL_PIN' was not declared in this scope
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:248:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SCL_OUT (SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:399:44: note: in expansion of macro 'SCL_OUT'
[SCLIN] "I" (SCL_IN), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:248:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SCL_OUT (SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:399:44: note: in expansion of macro 'SCL_OUT'
[SCLIN] "I" (SCL_IN), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:245:39: error: 'SDA_PORT' was not declared in this scope
#define SDA_DDR (_SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:400:23: note: in expansion of macro 'SDA_DDR'
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:400:47: error: 'SDA_PIN' was not declared in this scope
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN),
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'bool i2c_start(uint8_t)':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:245:39: error: 'SDA_PORT' was not declared in this scope
#define SDA_DDR (_SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:470:25: note: in expansion of macro 'SDA_DDR'
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:470:49: error: 'SDA_PIN' was not declared in this scope
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:471:22: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:471:22: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:248:38: error: 'SCL_PORT' was not declared in this scope
#define SCL_OUT (SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:471:46: note: in expansion of macro 'SCL_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:472:43: error: 'SCL_PIN' was not declared in this scope
[SCLIN] "I" (SCL_IN),[SCLPIN] "I" (SCL_PIN));
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'bool i2c_rep_start(uint8_t)':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:246:39: error: 'SCL_PORT' was not declared in this scope
#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:535:25: note: in expansion of macro 'SCL_DDR'
: : [SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:535:49: error: 'SCL_PIN' was not declared in this scope
: : [SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:248:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SCL_OUT (SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:536:44: note: in expansion of macro 'SCL_OUT'
[SCLIN] "I" (SCL_IN), [SCLOUT] "I" (SCL_OUT), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:248:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SCL_OUT (SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:536:44: note: in expansion of macro 'SCL_OUT'
[SCLIN] "I" (SCL_IN), [SCLOUT] "I" (SCL_OUT), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:38: error: 'SDA_PORT' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:536:68: note: in expansion of macro 'SDA_OUT'
[SCLIN] "I" (SCL_IN), [SCLOUT] "I" (SCL_OUT), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:537:47: error: 'SDA_PIN' was not declared in this scope
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN));
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'bool i2c_start_wait(uint8_t)':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:245:39: error: 'SDA_PORT' was not declared in this scope
#define SDA_DDR (_SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:651:24: note: in expansion of macro 'SDA_DDR'
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:651:48: error: 'SDA_PIN' was not declared in this scope
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:651:72: note: in expansion of macro 'SDA_OUT'
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:651:72: note: in expansion of macro 'SDA_OUT'
: : [SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAOUT] "I" (SDA_OUT),
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:250:35: error: 'SCL_PORT' was not declared in this scope
#define SCL_IN (_SFR_IO_ADDR(SCL_PORT) - 2)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:652:20: note: in expansion of macro 'SCL_IN'
[SCLIN] "I" (SCL_IN), [SCLPIN] "I" (SCL_PIN),
^~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:652:43: error: 'SCL_PIN' was not declared in this scope
[SCLIN] "I" (SCL_IN), [SCLPIN] "I" (SCL_PIN),
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'void i2c_stop()':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:246:39: error: 'SCL_PORT' was not declared in this scope
#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:720:25: note: in expansion of macro 'SCL_DDR'
: : [SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:720:49: error: 'SCL_PIN' was not declared in this scope
: : [SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:38: error: 'SDA_PORT' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:721:22: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:721:22: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:721:22: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:722:47: error: 'SDA_PIN' was not declared in this scope
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN));
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'bool i2c_write(uint8_t)':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:246:39: error: 'SCL_PORT' was not declared in this scope
#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:892:22: note: in expansion of macro 'SCL_DDR'
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:892:46: error: 'SCL_PIN' was not declared in this scope
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:38: error: 'SDA_PORT' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:893:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:893:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:893:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:894:46: error: 'SDA_PIN' was not declared in this scope
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAIN] "I" (SDA_IN));
^~~~~~~
In file included from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\io.h:99:0,
from c:\users\workpc\appdata\local\arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7\avr\include\avr\pgmspace.h:90,
from C:\Users\WorkPC\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6\cores\arduino/Arduino.h:28,
from C:\Users\WorkPC\AppData\Local\Temp\arduino-sketch-97DC7327E1C30D2D6F3AA606A26E2424\sketch\SmartBatteryHack.ino.cpp:1:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h: In function 'uint8_t i2c_read(bool)':
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:246:39: error: 'SCL_PORT' was not declared in this scope
#define SCL_DDR (_SFR_IO_ADDR(SCL_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1030:22: note: in expansion of macro 'SCL_DDR'
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
In file included from C:\Users\WorkPC\Desktop\SmartBatteryHack-master\Arduino\SmartBatteryHack\SmartBatteryHack.ino:1:0:
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1030:46: error: 'SCL_PIN' was not declared in this scope
[SCLDDR] "I" (SCL_DDR), [SCLPIN] "I" (SCL_PIN), [SCLIN] "I" (SCL_IN),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:38: error: 'SDA_PORT' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1031:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: error: 'SFR_IO_ADDR' was not declared in this scope
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1031:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:247:26: note: suggested alternative: '_SFR_IO_ADDR'
#define SDA_OUT (SFR_IO_ADDR(SDA_PORT) - 1)
^
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1031:21: note: in expansion of macro 'SDA_OUT'
[SDAOUT] "I" (SDA_OUT), [SCLOUT] "I" (SCL_OUT),
^~~~~~~
C:\Users\WorkPC\Documents\Arduino\libraries\SoftI2CMaster-master\src/SoftI2CMaster.h:1032:46: error: 'SDA_PIN' was not declared in this scope
[SDADDR] "I" (SDA_DDR), [SDAPIN] "I" (SDA_PIN), [SDAIN] "I" (SDA_IN)
^~~~~~~

exit status 1

Compilation error: exit status 1

@laszlodaniel
Copy link
Owner

Have you modified the header of the sketch? I only get these errors when the defines are commented out:

#include <avr/wdt.h>

#if defined (__AVR_ATmega328P__) || defined (__AVR_ATmega328__) // Arduino Uno hardware I2C pins
    #define SDA_PORT PORTC
    #define SDA_PIN 4
    #define SCL_PORT PORTC
    #define SCL_PIN 5

#elif defined (__AVR_ATmega1280__) || defined (__AVR_ATmega2560__) // Arduino Mega hardware I2C pins
    #define SDA_PORT PORTD
    #define SDA_PIN 1
    #define SCL_PORT PORTD
    #define SCL_PIN 0

#else // for other boards select I2C-pins here
    #define SDA_PORT PORTC
    #define SDA_PIN 4
    #define SCL_PORT PORTC
    #define SCL_PIN 5
#endif

#define I2C_PULLUP 1 // enable internal pullup resistors for I2C-pins
#define I2C_SLOWMODE 1 // 25 kHz
#define I2C_NOINTERRUPT 1 // interrupts may interfere with SMBus operations
#include <SoftI2CMaster.h> // https://github.com/felias-fogg/SoftI2CMaster

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants