[SOLVED] OLED_I2C example - compile problems

be80be
Posts: 5
Joined: Wed Sep 27, 2017 7:41 am

[SOLVED] OLED_I2C example - compile problems

Post by be80be » Wed Sep 27, 2017 7:59 am

Install problems on Linux I.m Burt I had this working before Now it shows im misssing something to use the oled with i2c

Code: Select all

 
  WARNING: Spurious .github folder in 'Adafruit NeoPixel' library
In file included from /home/burt/Arduino/hardware/Arduino_STM32-master/STM32F1/libraries/OLED_I2C/OLED_I2C.cpp:37:0:
/home/burt/Arduino/hardware/Arduino_STM32-master/STM32F1/libraries/OLED_I2C/hardware/arm/HW_STM32.h:1:22: fatal error: HardWire.h: No such file or directory
 #include "HardWire.h"
 

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

Re: OLED_I2C example - compile problems

Post by RogerClark » Wed Sep 27, 2017 11:25 am

Wire now defaults to HardWire, but it looks like that example has not been updated

Please edit /home/burt/Arduino/hardware/Arduino_STM32-master/STM32F1/libraries/OLED_I2C/hardware/arm/HW_STM32.h and change Hardwire.h to Wire.h

And let me know if that fixes is

Then I'll need to update github

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

Re: OLED_I2C example - compile problems

Post by RogerClark » Wed Sep 27, 2017 11:47 am

BTW.

If you could also let everyone know a bit about yourself and what project you are working on, that would be great, as thats what this section is all about.

be80be
Posts: 5
Joined: Wed Sep 27, 2017 7:41 am

Re: OLED_I2C example - compile problems

Post by be80be » Wed Sep 27, 2017 3:13 pm

Not much to say I just like to program. I use picchips more but the stm32 looked fun I had it working till I updated arduino to the new ide
Project is lighting . I'm a electrician
I'm more of a hardware guy. And a hacker lol
I can read code better then write it lol .

be80be
Posts: 5
Joined: Wed Sep 27, 2017 7:41 am

Re: OLED_I2C example - compile problems

Post by be80be » Wed Sep 27, 2017 6:29 pm

No hardwire problem now a new one If Im posting the wrong place sorry I worked on this for a day and I'm getting no where LOL

Code: Select all

Arduino: 1.8.4 (Linux), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

In file included from sketch/Wire.h:43:0,
                 from sketch/HardWire.h:42,
                 from sketch/HardWire.cpp:39:
sketch/WireBase.h:45:17: fatal error: i2c.h: No such file or directory
 #include "i2c.h"
                 ^
compilation terminated.
exit status 1
Error compiling for board Generic STM32F103C series.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

be80be
Posts: 5
Joined: Wed Sep 27, 2017 7:41 am

Re: OLED_I2C example - compile problems

Post by be80be » Wed Sep 27, 2017 6:34 pm

Well I figured that problem out I had added the files last night I removed them now i got this I think I can fix it

Code: Select all

Arduino: 1.8.4 (Linux), Board: "Generic STM32F103C series, STM32F103C8 (20k RAM. 64k Flash), STM32duino bootloader, 72Mhz (Normal), Smallest (default)"

/home/burt/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...")
                                                         ^
/home/burt/Arduino/hardware/Arduino_STM32-master/STM32F1/libraries/OLED_I2C/OLED_I2C.cpp: In member function 'void OLED::begin()':
/home/burt/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")
                                              ^
/home/burt/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")
                                             ^
Archiving built core (caching) in: /tmp/arduino_cache_713881/core/core_Arduino_STM32-master_STM32F1_genericSTM32F103C_device_variant_STM32F103C8,upload_method_DFUUploadMethod,cpu_speed_speed_72mhz,opt_osstd_2d83c63dff8fd59519291120a2799b6c.a

Sketch uses 79792 bytes (121%) of program storage space. Maximum is 65536 bytes.
Global variables use 7368 bytes (35%) of dynamic memory, leaving 13112 bytes for local variables. Maximum is 20480 bytes.
Sketch too big; see http://www.arduino.cc/en/Guide/Troubleshooting#size for tips on reducing it.
Error compiling for board Generic STM32F103C series.

This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.

thanks Roger

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

Re: OLED_I2C example - compile problems

Post by RogerClark » Wed Sep 27, 2017 9:21 pm

OK.

There is still a bug in the code in my repo, because I removed HardWire.h as it is now the same as Wire.h

I will check the other libraries and examples and confirm nothing else needs to be updated.

be80be
Posts: 5
Joined: Wed Sep 27, 2017 7:41 am

Re: OLED_I2C example - compile problems

Post by be80be » Wed Sep 27, 2017 9:31 pm

One was to big I made some changes to the Adafruit_SSD1306 one and it complied.
going to see if it works got hook up the oled

Code: Select all

#include <avr/pgmspace.h>
#ifndef __SAM3X8E__ || __STM32F1__
#endif
//#include <util/delay.h>
#include "Wire.h"
#define WIRE_WRITE HWIRE.write

#include <stdlib.h>

//#include <HWIRE.h>
//#include <HardWire.h>
//HardWire HWIRE(1,I2C_FAST_MODE); // I2c1
HardWire HWIRE(2,I2C_FAST_MODE); // I2c2
#include "Adafruit_GFX.h"
#include "Adafruit_SSD1306_STM32.h"

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

Re: OLED_I2C example - compile problems

Post by RogerClark » Wed Sep 27, 2017 9:45 pm

BTW. i noticed, that the library seems to use I2C device 2.

I am not sure why it does this. So you may want to change the code if you dont already have something connected to device 1

zmemw16
Posts: 1578
Joined: Wed Jul 08, 2015 2:09 pm
Location: St Annes, Lancs,UK

Re: OLED_I2C example - compile problems

Post by zmemw16 » Wed Sep 27, 2017 10:44 pm

i2c1 has 24c02 on 0x50 & 0x51 already known
shouldn't conflict, pretty sure ssd1306 is elsewhere
more likely is how to use both i2c[1/2] at same time and declaration thereof - similar to spi[2] ?
srp

Post Reply