Go Down

Topic: using oled display with ardunio (Read 47 times) previous topic - next topic

wachk

I have used the oled example ( small_ oled ) as it is to write sucessfuly to a ssd1306 display. the program worked well with out any problems. I then modifed the program to add an additional screen and the display never showed the first screen but showed the second screen. I added a long ( 5000) delay, still did not show the first screen. increasing the delay never showed the first screen. I inserted print statements and monitored the running of the program. the print statements showed the program to be working through the first screen write but the information never appeared on the screen.

orignal small _oled that workes

 Serial.print( "start");
  display.display ();
  // Clear the display
  display.clearDisplay();
  //Set the color - always use white despite actual display color
  display.setTextColor(WHITE);
  //Set the font size
  display.setTextSize(1);
  //Set the cursor coordinates
  display.setCursor(0,0);
  display.print(" test @ size 1");
  Serial.println ("running");
  display.setCursor(0,10);
  display.print (" its working");
   display.setCursor(0,20);
  display.print (" like it should");
 display.startscrollleft(0x00, 0x00);
  delay(2000);
  display.stopscroll();
  delay(1000);
}

modified program (small _oled2)
  Serial.print( "start");
//   display.display ();
  delay (2000);
  // Clear the display
  display.clearDisplay();
  //Set the color - always use white despite actual display color
  display.setTextColor(WHITE);
  //Set the font size
  display.setTextSize(1);
  //Set the cursor coordinates
  display.setCursor(0, 0);
  display.print(" test @ size 1");
  Serial.println (" 1 running");
  display.setCursor(0, 10);
  display.print (" its working");
  display.setCursor(0, 20);
  display.print (" like it should");
  delay (1000);
  display.clearDisplay();
  //Set the color - always use white despite actual display color
  display.setTextColor(WHITE);
  //Set the font size
  display.setTextSize(1);
//set the cursor coordinates
  display.setCursor(0, 0);
 display.print(" test #2");
  Serial.println ("2 running");
  delay (10000);
 
   display.setCursor(0, 10);
  display.print (" it also works");
  display.setCursor(0, 20);
  display.print (" like it should");
}

Is there any one who can explain why this does not work
thanks
Wachk

srnet

Suggest you read the post at the top of the forum with the title;

How to use this forum - please read

It will tell you how to psot your code so it is easy to read.

Not much point in posting fragments of code that cannot work, because they are incomplete, the problem with the code might well be in the bit you dont post, so post complete code.   
http://www.50dollarsat.info/
http://www.loratracker.uk/

Go Up