[SOLVED] OLED_I2C

Post Reply
User avatar
RenatoJr17
Posts: 6
Joined: Mon Jan 22, 2018 9:39 pm
Location: Brasil

[SOLVED] OLED_I2C

Post by RenatoJr17 » Mon Jan 22, 2018 9:50 pm

I can not compile a library ever this error, what can I do? I'm a newbie.

Code: Select all

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:36:57: note: #pragma message: Compiling for STM32F1 Architecture...

  #pragma message("Compiling for STM32F1 Architecture...")

                                                         ^

In file included from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:37:0:

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h: In member function 'void OLED::_initTWI()':

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:22:7: error: 'HWIRE' was not declared in this scope

       HWIRE.begin();

       ^

In file included from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:37:0:

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:38:9: error: 'HWIRE' was not declared in this scope

         HWIRE.begin();

         ^

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h: In member function 'void OLED::update()':

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:85:10: error: 'HWIRE' was not declared in this scope

          HWIRE.beginTransmission(SSD1306_ADDR);

          ^

In file included from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:37:0:

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:2:20: error: 'HWIRE' was not declared in this scope

 #define WIRE_WRITE HWIRE.write

                    ^

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:113:13: note: in expansion of macro 'WIRE_WRITE'

             WIRE_WRITE(aa);

             ^

In file included from C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:37:0:

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:124:9: error: 'HWIRE' was not declared in this scope

         HWIRE.endTransmission();

         ^

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h: In member function 'void OLED::_sendTWIcommand(uint8_t)':

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\hardware/arm/HW_STM32.h:140:9: error: 'HWIRE' was not declared in this scope

         HWIRE.beginTransmission(SSD1306_ADDR);

         ^

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp: In member function 'void OLED::begin()':

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:73:46: note: #pragma message: I2C HW mode enabled

         #pragma message("I2C HW mode enabled")

                                              ^

C:\Program Files (x86)\Arduino\hardware\Arduino_STM32-master\STM32F1\libraries\OLED_I2C\OLED_I2C.cpp:80:45: note: #pragma message: SCL pinmode OUTPUT

         #pragma message("SCL pinmode OUTPUT")

                                             ^

exit status 1
Erro compilando para a placa Generic STM32F103C series
Last edited by RenatoJr17 on Fri Jan 26, 2018 3:56 am, edited 1 time in total.

User avatar
Pito
Posts: 1743
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

Re: OLED_I2C

Post by Pito » Mon Jan 22, 2018 10:05 pm

Show your sketch..
Pukao Hats Cleaning Services Ltd.

User avatar
mrburnette
Posts: 2232
Joined: Mon Apr 27, 2015 12:50 pm
Location: Greater Atlanta
Contact:

Re: OLED_I2C

Post by mrburnette » Mon Jan 22, 2018 10:26 pm

RenatoJr17 wrote:
Mon Jan 22, 2018 9:50 pm
I can not compile a library ever this error, what can I do? I'm a newbie.
...
exit status 1
Erro compilando para a placa Generic STM32F103C series
[/code]
What we need to know always is:
  • What version of ArduinoIDE you are using
  • What OS are you running
  • And the full source code or link if from an online source.
However in this case, I suspect a mismatch between some old OLED code
https://github.com/rogerclarkmelbourne/ ... s/OLED_I2C
that did not get updated with a core update.

The core has undergone many changes in SPI and I2C. In a "perfect world" members who craft changes should always sanity test their changes by compiling every example file in the "master" get Hub repository. In this case, I do not think that happened :ugeek:
(Although I do see an update just 20 days ago, so I may be mistaken.)

Give us a little time to check things out. I am on my tablet and away from my workshop.

Ray

User avatar
RenatoJr17
Posts: 6
Joined: Mon Jan 22, 2018 9:39 pm
Location: Brasil

Re: OLED_I2C

Post by RenatoJr17 » Mon Jan 22, 2018 10:55 pm

Pito
I'm using the library's ready sketch.

mrburnette
What version of ArduinoIDE you are using -- 1.8.5
What OS are you running -- win 10
And the full source code or link if from an online source. -- full source code

I will update the library with the link you gave me and test

thanks.

User avatar
RogerClark
Posts: 7693
Joined: Mon Apr 27, 2015 10:36 am
Location: Melbourne, Australia
Contact:

Re: OLED_I2C

Post by RogerClark » Tue Jan 23, 2018 12:34 am

Looks like this library did not get changed when the I2C (Wire) library was changed to use Hardware instead of software I2C

I think the problem is here

https://github.com/rogerclarkmelbourne/ ... HW_STM32.h


Try changing references to HWIRE.xxxx to Wire.xxxxx

User avatar
RenatoJr17
Posts: 6
Joined: Mon Jan 22, 2018 9:39 pm
Location: Brasil

Re: {SOLVED] OLED_I2C

Post by RenatoJr17 » Fri Jan 26, 2018 3:58 am

thank you all, it was just the outdated library.

Post Reply