Open GoogleCodeExporter opened 8 years ago
Oops ug8_InitComFn needs to be in main. I guess late night and looking at too
many examples it didn't make it there.
Now I am getting these
Error: Undefined symbol u8g_com_arduino_port_d_wr_fn (referred from
u8g_dev_ili9325d_320x240.c.LPC11U24.o).
Error: Undefined symbol u8g_com_arduino_no_en_parallel_fn (referred from
u8g_dev_sbn1661_122x32.c.LPC11U24.o).
Error: Undefined symbol u8g_com_arduino_sw_spi_fn (referred from
u8g_dev_st7687_c144mvgd.c.LPC11U24.o).
Error: Undefined symbol u8g_com_arduino_st7920_custom_fn (referred from
u8g_dev_st7920_128x64.c.LPC11U24.o).
Original comment by blackspa...@gmail.com
on 27 Dec 2014 at 8:02
I was able to comment out the lines referring to Arduino.
Original comment by blackspa...@gmail.com
on 27 Dec 2014 at 8:09
There is a cpp wrapper for u8glib.
Usually the code tries to detect the target system by the some compiler
switches. This will probably fail for an unsupported environment. So i think it
is ok to remove the arduino specific code.
A nice tutorial is here: http://blog.bastelhalde.de/?p=759
Original comment by olikr...@gmail.com
on 28 Dec 2014 at 8:10
Thanks, that site came in handy as well as
https://forum.pjrc.com/threads/24357-u8glib-now-has-an-ARM-variant
I finally got it to compile but display isn't working yet. Have to play with it
some more
I have a SeeedStudio Arch connected to a 128x64 OLED with SSD1306. I will be
trying on the Pro and STM32 once I get it working.
From what I have read Mbed will detect c or cpp and compile each properly. I
guess you can mix c with cpp.
Original comment by blackspa...@gmail.com
on 28 Dec 2014 at 8:15
Does the CPP wrapper allow use of the U8Glib as a object like the way its is
called in Arduino?
Where is the wrapper, I haven't found it?
Original comment by blackspa...@gmail.com
on 29 Dec 2014 at 7:18
The wrapper is only used for the Arduino environment. It is not part of the ARM
and AVR distribution, however it is here in the repo:
https://code.google.com/p/u8glib/source/browse/#hg%2Fcppsrc
Additionally the wrapper class is derived from the Arduino "print" class. The
"print" class is the standard way to print information on the serial (or any
other) interface. The print class is not part of u8glib, but it is a standarde
class of the Arduino environment.
All u8glib specific variables are located in a c structure (u8g_t). The C++
object is a class around the c structure:
{{{
class U8GLIB : public Print
{
private:
u8g_t u8g;
...
}}}
Original comment by olikr...@gmail.com
on 29 Dec 2014 at 7:30
Thanks, would it be possible to use printf in the ARM environment?
Without the c++ wrapper, how can you print at the current position?
I am porting Arduino code to ARM.
Original comment by blackspa...@gmail.com
on 29 Dec 2014 at 7:34
Except for the c++ wrapper the code is identical for ARM and Arduino.
The C interface has u8g_DrawStr to draw a string at a given position. To
convert a value, use sprintf or itoa or something similar. These functions
should be part of your standardlibraries (string.h, stdlib.h)
Original comment by olikr...@gmail.com
on 29 Dec 2014 at 8:38
Sprintf does work.
How can I drawstr without specifying position. Just draw at the end pixel? Like
print does.
Original comment by blackspa...@gmail.com
on 29 Dec 2014 at 8:40
DrawStr returns the x offset: You need a variable like
int x = 20;
Where 20 is your initial x position. For the first draw, use:
x += ...DrawStr(x,y,...)
For the next draw, again use
x += ...DrawStr(x,y,...)
Have a look at the wrapper code...
Original comment by olikr...@gmail.com
on 29 Dec 2014 at 11:52
the refered code is in line 90 of U8glib.h
Original comment by olikr...@gmail.com
on 29 Dec 2014 at 11:55
Original issue reported on code.google.com by
blackspa...@gmail.com
on 27 Dec 2014 at 7:49