Show Posts
Pages: [1] 2 3 ... 96
1  Using Arduino / Displays / Re: Library Size on: Today at 01:52:24 pm
I tried to develop Ucglib with the smallest possible footprint. But sure, it still requires some flash rom memory.
Your code also make use of floating point. That also eats up a lot of memory. And the: You use some other libs. What about their size.
One idea: Using double and float requires more memory than only double or float variables. You can also try to use only one font, which will also reduce the flash rom size.

Oliver
2  Using Arduino / Programming Questions / Re: What's the difference between Adafruit SSD1306 and SH1106? on: Today at 01:44:13 pm
In fact I do not much about the Adafriut library. But what i have seen the commands might need to be adjusted. Best is to study the commands, which are sent by the Adafruit lib and update them according to the display. It also seems that some internal drawing area is defined. This usually is not required if this is the case.
I also think that it is better to draw each page (128x8 pixel area) individually instead of writing all the 128x64 pixel at once. That means i think it is better to use two nested loops instead of one loop. This would also allow you to send commands at the begin of the page:
Code:
for( page = 0; page < 8; page ++ ) {
  // send commands to place cursor at the correct page start position
  for( i = 0; i < 128; i++ ) {
    // write page
  }
}

Oliver
3  Using Arduino / Displays / Re: SSD1306 128x64 to 64x48 size Oled Display on: July 22, 2014, 02:14:12 pm
The OLED has a size of 64x48. The controller has a size of 128x64 pixel. The question is, how is the OLED window mapped into the 128x64 RAM are of the controller.
Or: How is the upper left corner of the OLED display mapped onto the RAM of the controller.
This is very specific to the connection between controller and OLED and can have (almost) any mapping. For example if the OLED display is centered in the RAM of the controller, then the upper left corner of the display has the pixel coordinates (32,8).

Usually this is documented in the datasheet for the specific OLED module.

A similar discussion is here: http://forum.arduino.cc/index.php?topic=256374.msg1814470#msg1814470

Oliver
4  Using Arduino / Programming Questions / Re: What's the difference between Adafruit SSD1306 and SH1106? on: July 22, 2014, 02:03:52 pm
There is only one small difference between SSD1306 and SH1106: The SH1106 controller has an internal RAM of 132x64 pixel. The SSD1306 only has 128x64 pixel.

First problem for standard 128x64 OLEDs with SH1106 controller is: How is the 128x64 window mapped into the 132x64 RAM?
It seems, that the 128x64 OLED is centered in most cases within the 132x64 area, that means pixel (2,0) in ram is pixel (0,0) on the display.

For u8glib, the update for the SH1106 was very small. I just had to shift the display by 2 pixel. This is more complicated with the Adafruit lib. Mainly the procedure "Adafruit_SSD1306::display(void)" depends very much on the hardware architecture and assumes, that the width of the RAM area is 128 (which is wrong for the SH1106). I think the procedure Adafruit_SSD1306::display(void) needs to be rewritten completly (including the commands, which are sent).

Oliver

5  Using Arduino / Displays / Re: SSD1306 128x64 to 64x48 size Oled Display on: July 22, 2014, 01:48:13 pm
hmm... you could use u8glib and modify the SSD1306 128x64 driver:

https://code.google.com/p/u8glib/source/browse/csrc/u8g_dev_ssd1306_128x64.c

First, change WIDTH and HEIGHT to 64 and 48 (lines 39 and 40).
Then update the init sequence. By default this is u8g_dev_ssd1306_128x64_adafruit3_init_seq (line 112).

After this, you should be able to at least see something with the U8GLIB_SSD1306_128x64 constructor.

Oliver

6  Using Arduino / Programming Questions / Re: Menu for Display on: July 22, 2014, 01:42:22 pm
Hi

As discussed here, you must define your own event source procedure:
https://code.google.com/p/m2tklib/wiki/t11#Numeric_Key_Pad

It might look like this:
Code:
uint8_t m2_es_gnusso(m2_p ep, uint8_t msg)
{
  switch(msg)
  {
    case M2_ES_MSG_GET_KEY:
      // make a call to the read num key libary
     // then check for the key
     // then return one of M2_KEY_SELECT or M2_KEY_NEXT or ...
      break;
    case M2_ES_MSG_INIT:
      break;
  }
  /* call Arduino standard event source */
  // may not be required
  // return m2_es_arduino(ep, msg);
}

Then your m2 constructor will look differently:

Code:
M2tk m2(&m2_null_element, m2_es_gnusso, m2_eh_6bs, m2_gh_lc);

Additionally, calls to m2.setPin are not required any more. This is instead handled by your new event source "m2_es_gnusso".

Oliver
7  Using Arduino / Displays / Re: ST9720 128x64 - slow loop time, what can I do ? Due/u8glib/HWSPI ? on: July 21, 2014, 04:16:09 pm
For sure, there is a plan to add HW SPI for U8glib... but currently i do not have much time for this project  smiley-roll

Oliver
8  Using Arduino / Displays / Re: ST9720 128x64 - slow loop time, what can I do ? Due/u8glib/HWSPI ? on: July 20, 2014, 05:19:05 pm
I still think the performance problem is not because of U8glib. What I understood so far is, that your software must do several things in parallel:
- Control Backlight
- Read keys
- Display a menu
- Execute u8glib

These tasks have to happen in parallel, otherwise they will distrub and delay each other.

Just to check the performance, try the chess demo example. Or download M2tklib for U8glib and do some testing with the menues. The control of the backlight is a secondary problem. Solve the menu problem first.

Quote
Just one question about running HW SPI on the due, i know it does not work, BUT
when I tried to make it work and the screen was blank, even if it was not working, does the picture loop still fully executed ?
does the arduino try to write to the screen full time or the code is ignored ? 


The low level procedures will evaluate to a nul function. The picture loop is still fully executed.

Oliver
9  Using Arduino / Displays / Re: ST9720 128x64 - slow loop time, what can I do ? Due/u8glib/HWSPI ? on: July 20, 2014, 09:52:10 am
Code:
displayMain();
if(btnOK()==true){
  //menu draw
 displayMenu();
}
This does not make sense, because displayMenu() will overwrite the output of displayMain(). You will never see the output of displayMain(). Maybe use a else clause here?

Code:
  while(!btnBack()){
  u8g.firstPage(); 
  do {
  u8g.setFont(u8g_font_baby);
    u8g.drawStr( 0, 5, "Menu");
    u8g.drawLine(0, 7, 128, 7); 
 } while( u8g.nextPage() );
}
The code of btnBack() is not shown, but the code will force to redraw the screen with constant data. I think you could do something like this:
Code:
  if(!btnBack()){
  u8g.firstPage(); 
  do {
  u8g.setFont(u8g_font_baby);
    u8g.drawStr( 0, 5, "Menu");
    u8g.drawLine(0, 7, 128, 7); 
 } while( u8g.nextPage() );
while(!btnBack())
   ;
}
This would at least improve the reaction time.

Quote
still buttons are misfiring.
I think this is mainly because of the missing debouncing. You should check for a transition from true to false of the btnOk() function.

Quote
from what i understand there is no stopping the picture loop,
At least, you should not jump out of the loop or terminate the loop. Still, you can decide not to execute the complete loop as long as nothing has changed.

Maybe it is worth to study this tutorial: https://code.google.com/p/u8glib/wiki/tmenu. Especially the part about code optimization (the use of the update variable).



Oliver
10  Using Arduino / Displays / Re: ST9720 128x64 - slow loop time, what can I do ? Due/u8glib/HWSPI ? on: July 20, 2014, 06:36:00 am
Hi

HW SPI will not increase speed in all cases. One common cause for slow refresh is using something else than pure u8glib graphics functions inside the picture loop. In general you should place commands like AnalogRead() outside of the picture loop, store the result of AnalogRead in a global variable and draw the value of this global inside the picture loop. Same applies to all kind of calculation, which should also happen outside the picture loop.

Please paste your picure loop for further discussion.

Oliver
11  Using Arduino / Displays / Re: Seeed Studio Custom Defined Libraries and Applications on: July 20, 2014, 01:49:28 am
Hi rsk22

Thanks a lot for writing this library.

Are there installation instructions? Can you provide a link to TFT.h? It is also not clear to my, how to install your library.
Additional question: TFT.h is already part of the Arduino IDE. Is this the same library?

Can you also provide the link to the display itself.

Then: I did not found the code for Arduino-TouchScreen-ZapAMole

Good work and nice C++ Code
Oliver

12  Using Arduino / Displays / Re: Suggestions for easy to use (and cheap) TFT screens? on: July 18, 2014, 11:51:46 pm
Did you look at this thread: http://forum.arduino.cc/index.php?topic=222327.0
My suggestion is to buy a ST7735/160x128 Color TFT. This is also software compatible with the TFT from the Arduino store.


If you search for "ST7735 160x128 Color TFT", you will find devices, starting from $5 with free shipping from far east.

Such a display is also available in Germany:
http://www.exp-tech.de/Displays/1-8-18-bit-color-TFT-LCD-display-with-microSD-card-breakout-ST7735R.html

Oliver
13  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 18, 2014, 01:54:47 pm
Thanks for your report on this display.

Oliver
14  Using Arduino / Displays / Re: OLED display with 4-wire SPI mode, but without CS on: July 17, 2014, 11:27:56 pm
Yes, you are right. My calculation was wrong. I also guess it receives 3V only.

Maybe the display can be connected to 5V power source of the Due (3.3V logic level).

Oliver
15  Using Arduino / Programming Questions / Re: Menu for Display on: July 17, 2014, 03:04:21 pm
Sure, let me know if you have further questions.

Oliver
Pages: [1] 2 3 ... 96