I do not understand the error.......

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hellooo there.

 

I bought a couple of theres for a project:

 

https://www.amazon.com/gp/produc...

 

And to test them out I did a search through the Arduino IDE and they had a 'U8g2' library that has the controller I am using so I downloaded that and opened up the KEYWORD.txt file, and the 'Hello World' INO and from thee set it up to the controller I am using and sent it to the UNO

 

IT WORKED!!  Yippee!

 

Ok, so theres a list of fonts on the KEYWORDS.txt file and in the LITERALS section is a list of fonts, and a search shows the default font that is in the 'Hello World!' INO file.

 

 

 u8x8.setFont(u8x8_font_chroma48medium8_r);

 

 

I decide that I would like to try another font that is in the list.

 

u8x8.setFont(u8g2_font_artosserif8_8r);

 

Save the INO and hit compile and I get this back:

C:\Users\jgmDESIGNS\Documents\Arduino\HelloWorld_jgm\HelloWorld_jgm.ino: In function 'void setup()':
HelloWorld_jgm:252:3: error: 'u8x8' was not declared in this scope
   u8x8.begin();
   ^~~~
C:\Users\jgmDESIGNS\Documents\Arduino\HelloWorld_jgm\HelloWorld_jgm.ino:252:3: note: suggested alternative: 'U8X8'
   u8x8.begin();
   ^~~~
   U8X8
C:\Users\jgmDESIGNS\Documents\Arduino\HelloWorld_jgm\HelloWorld_jgm.ino: In function 'void loop()':
HelloWorld_jgm:260:3: error: 'u8x8' was not declared in this scope
   u8x8.setFont(u8g2_font_artosserif8_8r);
   ^~~~
C:\Users\jgmDESIGNS\Documents\Arduino\HelloWorld_jgm\HelloWorld_jgm.ino:260:3: note: suggested alternative: 'U8X8'
   u8x8.setFont(u8g2_font_artosserif8_8r);
   ^~~~
   U8X8
HelloWorld_jgm:260:16: error: 'u8g2_font_artosserif8_8r' was not declared in this scope
   u8x8.setFont(u8g2_font_artosserif8_8r);
                ^~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\jgmDESIGNS\Documents\Arduino\HelloWorld_jgm\HelloWorld_jgm.ino:260:16: note: suggested alternative: 'u8x8_font_artosserif8_r'
   u8x8.setFont(u8g2_font_artosserif8_8r);
                ^~~~~~~~~~~~~~~~~~~~~~~~
                u8x8_font_artosserif8_r
exit status 1
'u8x8' was not declared in this scope

 

 

I find this odd, so I change the line back to the original font, and when I hit compile I get the same error.

 

 

Can someone explain what went wrong?

 

JIm

 

EDIT:

Attached .TXT file where I found the fonts

Attachment(s): 

This topic has a solution.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Sun. Feb 14, 2021 - 02:19 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

suggested alternative: 'U8X8' ???????

I know that the text file has lower case but who knows.

John Samperi

Ampertronics Pty. Ltd.

https://www.ampertronics.com.au

* Electronic Design * Custom Products * Contract Assembly

This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looks like the issue is "u8x8" is what I must use with this OLED.  If I call out anything with "U8g2" in the title I get the error.  I poked around the u8x8.h file for the INO and well duh!

 

 

Wonder where you would use teh U8g2 fonts.

 

Oh well.  I guess case closed.

 

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Go on.   It is pretty straightforward.   You can use U8g2lib and any of the hundreds of Fonts that Oliver provides.   e.g. writing Arabic or Chinese on your little SH1106 display.

 

If you restrict yourself to 8x8 fonts and zero graphics you can use the simpler libraries and less resources.

 

It all depends on what you want to do.

 

But the first job is to read https://github.com/olikraus/u8g2...

 

Where you can see "u8x8reference" https://github.com/olikraus/u8g2...

and https://github.com/olikraus/u8g2...

 

David.

Last Edited: Sun. Feb 14, 2021 - 08:39 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

david.prentice wrote:
Go on.   It is pretty straightforward.

 

Yup, and after I read a little more deeply I realised what the issue was with not being able to use teh other fonts.  It's a matter of how you set things up.

JIm

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user