Show Posts
Pages: 1 2 [3] 4 5 ... 97
31  Using Arduino / Displays / Re: print speed with ST7565 on: July 16, 2014, 10:46:11 pm
Often it is faster to store constant values like ~(1<<5) in a variable. Then you could do loop unrolling.

Oliver
32  Using Arduino / Displays / Re: print speed with ST7565 on: July 16, 2014, 03:05:20 pm
If I remember correctly, i did not add HW SPI support for the teensy.
In fact i was not able not spent much time to optimize U8glib for the teensy.
Basically U8glib will use the procedures in u8g_arduino_std_sw_spi.c to output the data.
You will find the following procedure:
Code:
void u8g_arduino_sw_spi_shift_out(uint8_t dataPin, uint8_t clockPin, uint8_t val)
{
  uint8_t i = 8;
  do
  {
    if ( val & 128 )
      digitalWrite(dataPin, HIGH);
    else
      digitalWrite(dataPin, LOW);
    val <<= 1;
    u8g_MicroDelay(); /* 23 Sep 2012 */
    //delay(1);
    digitalWrite(clockPin, HIGH);
    u8g_MicroDelay(); /* 23 Sep 2012 */
    //delay(1);
    digitalWrite(clockPin, LOW);
    u8g_MicroDelay(); /* 23 Sep 2012 */
    //delay(1);
    i--;
  } while( i != 0 );
}

Optimizing this procedure will probably highly increase speed. You could start to remove the u8g_MicroDelay() procedure one by one. Also replacing digitalWrite() with something else, could speed up the code a lot.

Oliver
33  Using Arduino / Programming Questions / Re: Menu for Display on: July 16, 2014, 01:54:34 pm
Of course the keypad can be used as input for m2tklib also. I created a tutorial for this:
https://code.google.com/p/m2tklib/wiki/t11

Oliver
34  Using Arduino / Programming Questions / Re: Menu for Display on: July 15, 2014, 01:53:55 pm
Ciao oliver, thanks but when I do a store procedure in my case index is a local variable inside a store procedure ... how can pass value to other store procedure ?
You can use the global or the local variable. Both is possible, but you should decide only for one of them.


mainly I would like a keypad when I didn't use M2TKLIB, i hope that now it's more clear ...  smiley-red?

ok, got it.

Oliver
35  Using Arduino / Displays / Re: print speed with ST7565 on: July 14, 2014, 11:41:01 pm
You could use the double speed constructor.
Code:
U8GLIB_LM6059_2X u8g(15, 16, 17, 18, 19);
Also HW SPI could be an option, if you change the pins.

I also suggest to reduce/avoid the number of float variables.
Perhaps sum and sum2 could be replaced by integer variables.

Oliver
36  Using Arduino / Displays / Re: Running four OLED (I2C) displays at once? on: July 14, 2014, 11:32:56 pm
Good to see it works.
However, for speed up do this call only once per OLED.

Oliver
37  Using Arduino / Displays / Re: 1.8" TFT LCD display with an Arduino Micro on: July 14, 2014, 04:45:47 pm
There are more libraries, which support the ST7735. There is TFT.h, which is included with the Arduino IDE, but also my own lib:  Ucglib, see here: https://code.google.com/p/ucglib/wiki/ucglib?tm=6

Oliver
38  Using Arduino / Programming Questions / Re: Menu for Display on: July 14, 2014, 12:59:54 pm
Hi

where i've defined the Procedure "clear buffer" I've used "index", when I use the procedure I use "ind" variabile for exchange value with other store procedure ... otherwise how i can share the value with other procedure ?

Instead of
Code:
clearBuffer(ind,messaggio);
also
Code:
clearBuffer(index,messaggio);
will work.

Then, after that for you it's working keypad ? for example you can print the keypad entry in serial ?
just for see if the code is executed,

I think, the best is to do a test. If your program behaves as expected, then it is good.
I do not no much about keypad, and still i am a little bit confused about how this is linked to m2tklib.

Oliver
39  Using Arduino / Displays / Re: Running four OLED (I2C) displays at once? on: July 14, 2014, 02:32:08 am
Hi

The problem is, that the other three displays do not receive the init code.
You need to call u8g.begin() for each of the attached OLEDs manually. u8g.begin() is called automatically if only one OLED is used, but in your case you need to switch to the four OLEDs and call u8g.begin() for each of the OLEDs.

I remember that we discussed a similar question recently here in the forum (with two OLEDs).

Oliver

Edit: Problem was discussed here (however, not sure whether this fits here): http://forum.arduino.cc/index.php?topic=248663
40  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
41  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

42  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

43  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
44  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

45  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
Pages: 1 2 [3] 4 5 ... 97