I have juat gotten some SH1106 displays for a project, looking throught the examples for the u8glib.h I noticed that a lot of the void declerration have void for asecond time within the brackets.
void draw(void) {
// graphic commands to redraw the complete screen should be placed here
u8g.setFont(u8g_font_unifont);
u8g.setPrintPos(0, 20);
// call procedure from base class, http://arduino.cc/en/Serial/Print
u8g.print("Hello World!");
}
I have not seen this before, is there a reason for it? Do i need to worry about doing the same when finally compiling my own programme?
To be honest it seem like a hold over from an older style/system of coding.
Technically, a function definition void draw{void) means that the function draw takes no arguments and returns no value, while void myfunc() COULD mean "this is an old-style C function that doesn't return a value; the arguments will be mentioned later."
(This "old style function definition" is apparently being removed from the next generation of the C specification. You shouldn't use it, and don't need to know about it!)