Author Topic: Newbie question on DigisparkOLED functionality  (Read 4505 times)

rob

  • Newbie
  • *
  • Posts: 5
Newbie question on DigisparkOLED functionality
« on: November 09, 2016, 05:47:20 am »
How do I find out the capabilities of a library like DigisparkOLED?  I've read all the files that came with the library and searched this and other forums but cannot find a list of functions or capabilities for that library.  For instance is there a brightness function?  Why can I not oled.println("  \ or )  "); characters?  What special characters are included, etc?

Any help in directing me to additional documentation would be greatly appreciated.

Thanks!

rob

  • Newbie
  • *
  • Posts: 5
Re: Newbie question on DigisparkOLED functionality
« Reply #1 on: November 15, 2016, 07:20:56 am »
Should I assume this question has no answer or is it just so obvious to everyone else that it doesn't justify a response?

just curious

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Newbie question on DigisparkOLED functionality
« Reply #2 on: November 15, 2016, 07:25:16 pm »
Think the answer is mainly there aren't too many people around/active on the forum, and of them, a question of how many use the OLED ;)

To partially answer the question of what functions... have a look at the header for DigisparkOLED, as that defines the functions. I don't see anything brightness related though.

As you why you can't print "\" or ")" I don't know... they're there in the fonts used for the OLED so they should be available. I'll have a look when I get home as I actually have a digispark (pro) on the desk at the moment with an oled on it... although it's about to be banished back into its storage container for a while again. :-O

PeterF

  • Hero Member
  • *****
  • Posts: 881
Re: Newbie question on DigisparkOLED functionality
« Reply #3 on: November 16, 2016, 02:39:44 am »
OK, so I don't have a Digispark (original) out with a ready-to-attach OLED display handy, but the Digispark Pro uses the same library, so if it works on that, I would expect the Digispark original will work also (program size and memory permitting)...

I was able to do exactly what you said - do a println to display a "\ or a (". Example code is below. The ")" displayed without any problem, and the "\" is an escape character (instructs that the following characters have a different meaning), so if you want to actually display it, you need to do a "\\" to display one "\" ;)

Code: [Select]
#include <DigisparkOLED.h>
#include <Wire.h>

void setup()
{
  //initialise the display
  oled.begin();

  //make sure that displays blank...
  oled.clear(); //all black
}

void loop()
{
  oled.setCursor(0, 0); //top left
  oled.setFont(FONT8X16);
  oled.println("You can print");
  oled.println("  \\ or )  ");
  oled.println("on the OLED!!");
 
  //endless loop
  while(1)
  {
    delay(100);
  }
}

rob

  • Newbie
  • *
  • Posts: 5
Re: Newbie question on DigisparkOLED functionality
« Reply #4 on: November 16, 2016, 06:19:41 am »
I very much appreciate the reply.  I'll test this code on mine and see if it works on the original.