Show Posts
Pages: [1] 2 3 ... 102
1  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: Today at 08:10:32 am
Interessting picture. How did you connect the display? Is it soldered directly? The flex cable is also very sensitive.

2  Using Arduino / Displays / Re: U8glib old siemens C55 Lcd *PCF8812 ? displays mirror image :( on: Today at 08:06:00 am

In line 105 of file u8g_dev_pcf8812_96x65.c you find this:
      if ( u8g_pb_WriteBuffer(pb, u8g, dev) == 0 )
          return 0;
This will output the internal buffer to the display. However, this probably needs to be inverted (you have not provided a picture, so i do not know how this is mirrored). Replace (!) these two linse with this code:

  uint8_t i = pb->width;
  while( i > 0 )
    u8g_WriteByte(u8g, dev, pb->buf[i] );

I did not test this, but maybe it will work.

3  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: Today at 06:49:50 am
You need ceramic caps. Size does not matter to much, but caramic caps are almost not available with more than 4.7uF, so i assume your 10uF or 100uF caps are of the wrong type.

You need this:

You can try with a 2.2uF electrolytic cap or your 10uF type. In principle you should be able (after initalization by the controller) to measure about 10V (or more) on one of the pins of the cap.
In principle ceramic caps have some electric advantages over electrolytic caps and are usually prefered (or required) for charge pumps as they are used in a display controller.


4  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: Today at 04:16:36 am
The 2.2uF ceramic caps are really required. Without these caps you will not see anything. You could use larger values, but lower values might also not work. Also electrolytic caps are not reliable here.

Another problem might be the setup. These kind of prototyping boards are not very reliable. There had been users, which did search for days and finally found, that the prototyping board has a defect. Also the connection to the display itself should be checked. Is it a flex cable? If so, ensure, that pins are not shorted. Use a scope or voltmeter to trace the all signal lines.

There might be dozends of errors. Only if you remove all of them, you will see something on the display. Just try to build up everything carefully. Check against all possible faults. Compare your setup with the datasheet. And remember: "If you believe something is right, you won't see what's wrong" ;-). ok, not sure if this is helpful...

But it also did apply to me: It took me days to make my own DOGXL160 working ...


5  Using Arduino / Displays / Re: U8glib old siemens C55 Lcd *PCF8812 ? displays mirror image :( on: Today at 02:10:03 am

Is the text output correct or also mirrored?
Is the HelloWorld example working correctly?

6  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: Today at 02:00:49 am
ok, looks good.

7  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: Today at 01:24:43 am

rest of the connections are as follow right?
ARDUINO                    LCD
PIN 13 SCK                    D0
PIN 11 SDA                   D3
PIN 10 CS                     CS
PIN  9 CD                     CD

Well, yes according to your documentation, this should be correct.
From your pictures: I have not seen how you did provide GND to the HC4050. Is it missing?

Maybe you can also send your U8glib constructor. Just to crosscheck this.

8  Using Arduino / Displays / Re: waveshare 0.96inch OLED display need help on: September 20, 2014, 01:17:05 pm

The display should work with U8glib. In the U8glib documentation, D/C is often refered as A0.
I suggest to use 4-wire SPI.

9  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: September 20, 2014, 02:07:31 am

Ah, did not recogniced the datasheet, sorry for this.

The connection looks ok. I could try to verify your setup if you sent a picture from your personal setup. But what you wrote looks good.

You did not write whether you add the required caps for the display. The display needs two caps, attached to it, see also the datasheet for this.

Here is the schematic for my own DOGXL160 (actually with a UC1610 controller):

U8glib has been tested with this setup and with this DOGXL160.

If you did not connect the reset  line to the Arduino, you should use the reset circuit from my schematic. Also note the cap C3 and C4 are also required in your case. In contrast R6 and C2 seem to build into your display, if i understand your datasheet correctly.

The CD signal is often (in U8glib) refered as A0. See the description on the U8glib device wiki page (below the table).

10  Using Arduino / Displays / Re: UC1610B with U8Glib / Can't interface correctly. on: September 19, 2014, 08:31:26 pm

U8glib only supports 4-wire SPI for the UC1610.
For further help, i suggest you add the datasheet of your display and a picture or diagram how you did connect the display to your Board.

11  Using Arduino / Displays / Re: Newhaven OLED displays - different versions on: September 18, 2014, 12:18:55 am
Excellent, thanks for reporting.

12  Using Arduino / Displays / Re: LCD menus with rotary encoder troubles. Using m2tklib on: September 15, 2014, 04:58:45 pm

Actually, is there a way to have an idle screen with the clock?

Sure, this is possible. First you need to figure out the inactivity. This is, if you never enter the if block in your main loop (m2.draw() is not executed for some seconds). For example, you can store the last active time in the if block. I created some code for this, but i did not test this. Same background information is also given here:

int32_t last_action_time = 0;
uint8_t is_menu_active = 1;

void loop() {
  if ( is_menu_active != 0 ) {
    if ( m2.handleKey() ) {
      last_action_time = millis();  // user input append, store event time
    if ( last_action_time > millis() + 20000 ) {  // nothing has happend for 20 sec.
     is_menu_active = 0;  // deactivate menu
      m2.setRoot(&m2_null_element);  // assign a predefined empty menu
  else {
    // here you can use lcd.print() to output time on the lcd.
    // ...

    // menu is deactivated, but key detection still works
   // check for any user input
    if ( m2.getKey() != M2_KEY_NONE ) {
      // input has happend, store event time, activate menu
      last_action_time = millis();
      is_menu_active = 0;
      m2.setRoot(&top_el_expandable_menu);  // restore the toplevel dialog box

Glad to see, that you managed to climb up the learning curve.

13  Using Arduino / Displays / Re: U8glib: Graphics Lib for LCDs and OLEDs on: September 15, 2014, 03:42:50 pm


The question regarding color displays  came up very often. I finally decided to split off color displays and created Ucglib:

It has some small differences: I removed the "picture loop" (because it does not make sense for color TFTs/OLEDs), added true color support to all graphics primitives and updated the fonts a little bit (actually i replaced one of the fonts with another font).

Ucglib has its own thread here:

Ucglib is quite young and it does not have the popularity as UTFT or the Adafruit Lib, But Ucglib is infact U8glib for color displays, especially for those users, who do not want to miss a large collection of fonts and an online documentation.


14  Using Arduino / Displays / Re: LCD menus with rotary encoder troubles. Using m2tklib on: September 15, 2014, 03:32:31 pm

I am sorry, that some of my suggestions lead to a syntax error. I actually did not test anything. But i am glad you figured out a configuration, that works for you.

A typical top menu looks like this:
M2_ROOT(el_root_set_time, "", "set time", &top_el_set_time);
M2_ROOT(el_root_set_alarm, "", "set alarm", &top_el_set_alarm);

M2_LIST(list_main_menu) = {

M2_VLIST(el_main_menu_vlist, NULL, list_main_menu);
M2_ALIGN(top_el_main_menu, "-1|1W64H64", &el_main_menu_vlist);

Instead of VLIST you can also use XYLIST, but VLIST automatically calculates the correct possition and ALIGN will center everything on the screen (so you do not need to deal with the xy position).

Of course for the constructor, you need to provide "top_el_main_menu" as a startingpoint for your menu structure.
Basically something like this will appear on the screen:

...........[set time]...................
...........[set alarm]..................

In fact it is usually a good idea to draw the desired layout before coding the menu.

Now it is time to code the "set time" dialog box. Let me just create a very simple input box. Sure it can be extended and enriched with some buttons:

[ok] [cancel]...........................

Now i think it is time to copy the data from my initial answer.

First, some tmporary variables are required for m2tklib:
uint8_t td_hour;
uint8_t td_min;
uint8_t td_sec;
You need to communicate through these variables. Values are taken from this global variables and user input is written to this variables.

Here is the code:
void td_ok_fn(m2_el_fnarg_p fnarg)
 // store the input data somewhere

M2_U8NUM(el_td_hour, "c2", 0,23,&td_hour);
M2_LABEL(el_td_sep1, NULL, ":");
M2_U8NUM(el_td_min, "c2", 0,59,&td_min);
M2_LABEL(el_td_sep2, NULL, ":");
M2_U8NUM(el_td_sec, "c2", 0,59,&td_sec);

M2_LIST(list_time) = { &el_td_hour, &el_td_sep1, &el_td_min, &el_td_sep2, &el_td_sec };
M2_HLIST(el_time, NULL, list_time);

M2_ROOT(el_td_cancel, NULL, "cancel", &el_top);
M2_BUTTON(el_td_ok, NULL, "ok", td_ok_fn);
M2_LIST(list_td_buttons) = {&el_td_cancel, &el_td_ok };
M2_HLIST(el_td_buttons, NULL, list_td_buttons);

M2_LIST(list_td) = {&el_time, &el_td_buttons };
M2_VLIST(top_el_set_time, NULL, list_td);
Please note, that the toplevel element has the name "top_el_set_time", which is refered by M2_ROOT from your top level menu. In fact M2_ROOT is like a goto statement. I acts like a button. Once pressed, it will give control to another dialog box.
Again, you could replace the nested VLIST and HLIST elements with a single XYLIST, but i prefer the automatic calculation of positions. So i hope you can read most of the code and maybe the only new element is M2_BUTTON.
M2_BUTTON is very similar to M2_ROOT: It adds a button. But once pressed, it just calls a function. In this case the function is "td_ok_fn". You can use any name of course. In fd_ok_fn, you will know, that the user has pressed the ok button and you need to do something with the values in the three global values.

A similar structure needs to be added for the date input.

Hope i have you enough information for proceeding here. If not, please continue to ask.

15  Using Arduino / Displays / Re: LCD menus with rotary encoder troubles. Using m2tklib on: September 14, 2014, 02:18:46 pm
One more suggestion. I think with the rotary encoder it is better to use the 6-button handler:
M2tk m2(&top_el_hlist, m2_es_arduino_rotary_encoder, m2_eh_6bd, m2_gh_lc);

Additionally, you my want to change the events, which are sent by the rotary encoder:
Locate m2esarduino.c and
change line 233 to
      return M2_KEY_EVENT(M2_KEY_DATA_UP); /* disable debounce by M2tk algoritm */      
change line 245 to
      return M2_KEY_EVENT(M2_KEY_DATA_DOWN); /* disable debounce by M2tk algoritm */      

I think this will make more sense for you.

Pages: [1] 2 3 ... 102