Show Posts
Pages: 1 2 [3] 4 5 ... 96
31  Using Arduino / Programming Questions / Re: Menu for Display on: July 13, 2014, 02:24:15 am
I mean this:

Code:
clearBuffer(ind,messaggio);  // Use "index" here

You have two variables: A global variable "ind" and a local variable "index". There is not interference with m2tklib, it just could be a programming problem, that causes a buffer overflow, which again causes conflicts with other libraries.

Oliver
32  Using Arduino / Programming Questions / Re: Menu for Display on: July 12, 2014, 03:35:45 am
Hi

Well, the full code indeed shows, that ind/index are set to zero, which is good.
Still i find the mixing of ind and index dangerous and i still believe that your code may write after the end of the buffer.

I can just share my thoughts, but fixing i will not do  smiley-wink

Oliver

33  Using Arduino / Programming Questions / Re: Menu for Display on: July 12, 2014, 12:03:38 am
ok, so to me it seems the ReadKeypad is independent from M2tklib. In such a case, there might be a programming error, which causes your ReadKeypad to influence the m2tklib part (e.g. Bufferoverflow).

Let me briefly review your ReadKeypad procedure.
This is the call to it:
ReadKeypad(Tasto,messaggio,ind,UltimoTasto);

1. Stay with the local variable: "ind" is used inside ReadKeypad (use index instead). Never mix scope.
2. if ((millis() - 2000 > lastKey) || index == 15)
  the ceck for the index is only done if the first part of the or expression is true
3. index == 15
  Always be defensive, use index >= 15
4. I do not see where index or ind are set to 0
5. buffer[index] = 0: You are not checking for the size of the array. There are risks that you write at buffer[15] or beyond
6. From the code i also do not see the actual size of the array "messaggio"

My suggestion is to add much more checking for buffer overflow into your code.
Just before using the index, check for the correct size:

For example instead of
Code:
      buffer[index++] = key;
      buffer[index] = 0 ; // keep string correctly terminated ;
use
Quote
Code:
if ( buffer <= 13 )
{
      buffer[index++] = key;
      buffer[index] = 0 ; // keep string correctly terminated ;
}
Oliver

34  Using Arduino / Displays / Re: OLED display with 4-wire SPI mode, but without CS on: July 11, 2014, 04:16:37 pm
I got the following displays today from the above mentioned contact:
Blue 128x64 SPI OLED with the SH1106 controller.
White 128x64 SPI OLED with the SSD1306 controller.

The blue SH1106 OLED can be controlled by the Arduino Uno (5V power supply) and Arduino Due (3.3V power supply).

The white SSD1306 OLED only works with the Arduino Due (3.3V power supply). With the Uno the white OLED showed some flicker or did not work at all.

Blue OLED U8glib constructor:
Code:
U8GLIB_SH1106_128X64 u8g(4, 5, 6, 7); // SW SPI Com: SCK = 4, MOSI = 5, CS = 6, A0 = 7

White OLED U8glib constructor:
Code:
U8GLIB_SSD1306_128X64 u8g(4, 5, 6, 7); // SW SPI Com: SCK = 4, MOSI = 5, CS = 6, A0 = 7





I do not have a datasheet for these OLEDs. So I can not say, whether the OLEDs should be able to work with 5V or not.

Oliver
35  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 10, 2014, 09:54:50 pm
@Ray
The request was to support a display with RA8875 controller. This kind of display, i have not seen for less than $10.

Oliver

36  Using Arduino / Displays / Re: 0.96 oled with 4 pins wont work? on: July 10, 2014, 04:22:11 pm
Very good, thanks for the feedback.

Oliver
37  Using Arduino / Programming Questions / Re: Menu for Display on: July 10, 2014, 03:32:04 pm
Hi

Looks good, but the question is, what exactly do you expect to happen?
Additionaly i do not know this ReadKeypad library. Maybe you can provide a link to that library.

Oliver
38  Using Arduino / Displays / Re: ERC12864 display with the ST7565R controller on: July 10, 2014, 02:54:32 pm
Hi

U8glib supports displays, based on the ST7565 controller. Best is to try several U8glib constructors for that controller. Maybe one existing is fitting. If not, i can support to adjust an existing U8glib constructor.

The backlight is independent from the ST7565. Depending on the color, the maximum current is given on page 10 of the datasheet. You must apply an external resistor to meet the specification. If you connect the red/black wire directly to a power source you will destroy the backlight.
ResistorValue = (SupplyVoltage - VLED)/ILED

Whether the display is readable without the backlight depends on the "sunlight readable" attribute of your display (see page 6 of the data sheet). You will be able to read something without backlight if your display is "sunlight readable".

Oliver
39  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 10, 2014, 02:42:04 pm
Ok, looks nice. Still the main problem is the price. Ucglib is just a private project.

Oliver
40  Using Arduino / Displays / Re: 0.96 oled with 4 pins wont work? on: July 10, 2014, 02:37:17 pm
Thanks to this thread I got my display working!

Hurrah!

The only issue is that the output is shifted over to the left by what looks like two pixels — and I get a white line of pixels down the right hand side of the display.



James


Looks like you have a SH1106 display. Version 1.16 has a new constructor U8GLIB_SH1106_128X64, which differs from the U8GLIB_SSD1306_128X64 only in the shifting of two pixel. I would be interessted to see if that constructor works with your display.

Oliver
41  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 09, 2014, 01:31:27 pm
It seems to be difficult to find an SPI based display with RA8875 on ebay.

Oliver
42  Using Arduino / Displays / Re: Report: Inexpensive SPI based TFT Displays (PCF8833, ST7735, ILI9341) on: July 08, 2014, 02:51:09 pm
Hi

I do not own this device,so i can not test any implementation for this controller. Additionally i focus more on SPI based displays. Not sure whether this controller has an SPI input.

Oliver
43  Using Arduino / Displays / Re: 0.96 oled with 4 pins wont work? on: July 06, 2014, 07:27:49 am
U8glib support XBM file format. GIMP can convert pictures and export to XBM.

Oliver
44  Using Arduino / Displays / Re: 0.96 oled with 4 pins wont work? on: July 06, 2014, 02:35:52 am
Quote
If you say it WILL be supported by the NEXT U8glib release then how does yours work if the release is not out yet? what version of U8glib are you using? Could you please post a picture of the back of your oled

I released the new version (v1.16) of U8glib yesterday.
A picture of the back side has been posted two answers before.

Good, that your display now works.

Oliver
45  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: July 05, 2014, 11:45:43 pm
Hi

Without having this tested, i think the warning can be ignored.

Code:
const char szLabel[] PROGMEM = "Max:";  // defined in global space

u8g.getStrWidthP((unsigned char *)szLabel); // Inside a function
Pages: 1 2 [3] 4 5 ... 96