Re: DIY Tiny OLED I2C full graphics controller June 14, 2015 01:41PM |
Registered: 10 years ago Posts: 501 |
No idea of sainsmart..Quote
Yellobello
no datasheet for the sainsmart display
I've a couple of 7pin SPIs namedQuote
Yellobello
The connectors are called CS,RST,DC,SCLK,SDIN,GND and 3,3V..
Re: DIY Tiny OLED I2C full graphics controller June 14, 2015 02:26PM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller June 16, 2015 09:15AM |
Registered: 10 years ago Posts: 501 |
Re: DIY Tiny OLED I2C full graphics controller June 17, 2015 03:18AM |
Registered: 10 years ago Posts: 136 |
Re: DIY Tiny OLED I2C full graphics controller June 17, 2015 03:47AM |
Registered: 10 years ago Posts: 136 |
Re: DIY Tiny OLED I2C full graphics controller June 18, 2015 05:28AM |
Registered: 10 years ago Posts: 501 |
Quote
Yellobello
@bianchifan:
Why don´t you use the current marlin version from Git?
Re: DIY Tiny OLED I2C full graphics controller June 18, 2015 06:16AM |
Registered: 9 years ago Posts: 606 |
Re: DIY Tiny OLED I2C full graphics controller June 19, 2015 05:45AM |
Registered: 10 years ago Posts: 136 |
Re: DIY Tiny OLED I2C full graphics controller June 20, 2015 03:49AM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller June 20, 2015 04:47AM |
Registered: 10 years ago Posts: 136 |
Quote
n.glasson
As Enif has noted earlier, the side facing encoder has an illogical response depending on if you are scrolling menus or changing numeric values. If you set the encoder rotation in firmware to suit the menus (rolling the thumbwheel downwards at the front to scroll downwards), then when you reach a screen where you change a numeric value the same downwards rotation increases the numeric value. I'm not quite sure how easy it is to code to make the numeric value decrease with downwards rotation.
Re: DIY Tiny OLED I2C full graphics controller June 20, 2015 06:55AM |
Registered: 9 years ago Posts: 977 |
Quote
n.glasson
... The only negative symptom left was that the printer froze mid-print when I was printing from the SD card. I believe this is due to a conflict with both the thermocouple module and the SD card using the SPI. It prints reliably when I print from the computer i.e. without using the SD card.
...
Re: DIY Tiny OLED I2C full graphics controller June 21, 2015 10:03PM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller July 01, 2015 07:50PM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller July 02, 2015 02:21AM |
Registered: 10 years ago Posts: 590 |
Quote
n.glasson
...
As Enif has noted earlier, the side facing encoder has an illogical response depending on if you are scrolling menus or changing numeric values. If you set the encoder rotation in firmware to suit the menus (rolling the thumbwheel downwards at the front to scroll downwards), then when you reach a screen where you change a numeric value the same downwards rotation increases the numeric value. I'm not quite sure how easy it is to code to make the numeric value decrease with downwards rotation.
...
*** ultralcd.cpp.ori 2015-05-08 18:47:27.000000000 +0200 --- ultralcd.cpp 2015-05-08 18:47:31.000000000 +0200 *************** static void lcd_status_screen() { *** 328,333 **** --- 328,335 ---- #ifdef ULTIPANEL_FEEDMULTIPLY // Dead zone at 100% feedrate + encoderPosition = (unsigned)(-(int)encoderPosition); + if ((feedrate_multiplier < 100 && (feedrate_multiplier + int(encoderPosition)) > 100) || (feedrate_multiplier > 100 && (feedrate_multiplier + int(encoderPosition)) < 100)) { encoderPosition = 0;
Re: DIY Tiny OLED I2C full graphics controller July 03, 2015 02:39AM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller July 03, 2015 06:34PM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller July 04, 2015 06:10AM |
Registered: 10 years ago Posts: 590 |
Quote
n.glasson
It looks like the fix for the rotary encoder isn't quite 100% yet. I still find it works the wrong way in some places. For example when I am printing I can turn the speed up by twisting the knob upwards (at the front) when I am on the info screen, but when I select speed from the tune menu the knob needs to be twisted down to increase the speed...
--- ultralcd.cpp.ori103 2015-05-08 18:47:27.000000000 +0200 +++ ultralcd.cpp 2015-07-04 11:18:42.000000000 +0200 @@ -127,10 +127,18 @@ /** * START_MENU generates the init code for a menu function */ + + // reverse menu direction for encoders mounted on the side + #ifdef SIDE_ENCODER + #define MENU_DIR -1 + #else + #define MENU_DIR 1 + #endif + #define START_MENU() do { \ encoderRateMultiplierEnabled = false; \ - if (encoderPosition > 0x8000) encoderPosition = 0; \ - uint8_t encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ + if (MENU_DIR*encoderPosition < 0) encoderPosition = 0; \ + uint8_t encoderLine = MENU_DIR*encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; \ if (encoderLine < currentMenuViewOffset) currentMenuViewOffset = encoderLine; \ uint8_t _lineNr = currentMenuViewOffset, _menuItemNr; \ bool wasClicked = LCD_CLICKED, itemSelected; \ @@ -204,7 +212,7 @@ #define MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(type, label, args...) MENU_ITEM(setting_edit_callback_ ## type, label, PSTR(label), ## args) #endif //!ENCODER_RATE_MULTIPLIER #define END_MENU() \ - if (encoderLine >= _menuItemNr) { encoderPosition = _menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1; encoderLine = encoderPosition / ENCODER_STEPS_PER_MENU_ITEM; }\ + if (encoderLine >= _menuItemNr) { encoderPosition = MENU_DIR*(_menuItemNr * ENCODER_STEPS_PER_MENU_ITEM - 1); encoderLine = _menuItemNr-1; }\ if (encoderLine >= currentMenuViewOffset + LCD_HEIGHT) { currentMenuViewOffset = encoderLine - LCD_HEIGHT + 1; lcdDrawUpdate = 1; _lineNr = currentMenuViewOffset - 1; _drawLineNr = -1; } \ } } while(0) @@ -220,7 +228,7 @@ uint8_t currentMenuViewOffset; /* scroll offset in the current menu */ millis_t next_button_update_ms; uint8_t lastEncoderBits; - uint32_t encoderPosition; + int32_t encoderPosition; #if (SDCARDDETECT > 0) bool lcd_oldcardstatus; #endif @@ -1510,8 +1518,13 @@ //manage encoder rotation uint8_t enc=0; - if (buttons & EN_A) enc |= B01; - if (buttons & EN_ enc |= B10; + #ifndef SIDE_ENCODER + if (buttons & EN_A ) enc |= B01; + if (buttons & EN_B ) enc |= B10; + #else // for side encoders reverse rotation direction + if (buttons & EN_B ) enc |= B01; + if (buttons & EN_A ) enc |= B10; + #endif if (enc != lastEncoderBits) { switch(enc) { case encrot0:
Re: DIY Tiny OLED I2C full graphics controller July 04, 2015 05:51PM |
Registered: 10 years ago Posts: 77 |
Re: DIY Tiny OLED I2C full graphics controller August 07, 2015 02:57AM |
Registered: 10 years ago Posts: 60 |
Re: DIY Tiny OLED I2C full graphics controller August 19, 2015 04:47PM |
Registered: 9 years ago Posts: 2 |
#if defined(SSD1306_OLED_I2C_CONTROLLER) || defined(SH1106_OLED_I2C_CONTROLLER) #define LCD_SDSS -1 #define BTN_EN1 36 // A1 - rotary encoder A #define BTN_EN2 35 // A2 - rotary encoder B #define BTN_ENC 34 // A3 - rotary encoder push switch //#define BEEPER 10 // I dont need beeper #endifDid I miss some part of code to change?
Re: DIY Tiny OLED I2C full graphics controller August 20, 2015 09:45AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller August 20, 2015 02:09PM |
Registered: 9 years ago Posts: 2 |
Re: DIY Tiny OLED I2C full graphics controller August 20, 2015 02:20PM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 01, 2015 01:15PM |
Registered: 9 years ago Posts: 33 |
Re: DIY Tiny OLED I2C full graphics controller September 04, 2015 03:46PM |
Registered: 9 years ago Posts: 245 |
Re: DIY Tiny OLED I2C full graphics controller September 05, 2015 11:06AM |
Registered: 10 years ago Posts: 1,159 |
Re: DIY Tiny OLED I2C full graphics controller September 06, 2015 12:54AM |
Registered: 9 years ago Posts: 245 |
Doh, thanks - rather embarrased. That's what reading on tablet gets me (small letters). Or just being too busy..Quote
dougal1957
Quote
dintid
Wow $40 for a piece of bare PCB? Sure you didn't accidentialky add a zero in there? I would had bought one at $4.Quote
fredchan
Connector Borad for TinyoLED
www.hkmakers.hk
Cheers.
That's $40 Hong Kong equivalent to just over $5 US I think
Re: DIY Tiny OLED I2C full graphics controller September 24, 2015 11:58AM |
Registered: 9 years ago Posts: 245 |
Firstly: Very nice work manQuote
enif
This describes a little DIY project I did for building a I2C based tiny full graphic controller using the SSD1306 128x64 OLED display.
This OLED display comes in two sizes, 0.96" and 1.3", and can be ordered on eBay for a few dollars. So far I only have the 0.96" version, but I have now ordered the 1.3" version. Fortunately, the SSD1306 interface is already supported in U8GLIB, so no programming is needed, just some configuation changes. Since the OLED display uses the I2C, only 4 wires (VCC, GND, SCL, SDA) are needed for the display itself. Add to that the 3 signals for the rotary encoder plus one signal for an (optional!) piezo buzzer, to a total need for only 8 wires. I found this especially useful for the Sanguinololu, where not so many additional pins are available.
Other advantages of the OLED display are that is really bright, does not need any fiddling with the contrast, only draws a total current of about 8mA and, last but not least, works with either 5V or 3.3V supply and signals - the latter being particularly interesting for ARM based controller boards.
For building the controller you need the following:
- an SSD1306 I2C 128x64 OLED display (available as 0.96" or 1.3" versions)
- a rotary encoder with integrated click switch
- a piezo buzzer (optional, just for audible feedback of click)
- a piece of prototype PCB board (about 1.5"x2.5" is enough)
- some wires and pin headers
Here first the schematic how I wired the components and connected them to either RAMPS or Sanguinololu..
The modifications to Marlin are only minimal changes in the files Configuration.h, Conditionals.h, dogm_lcd_implementation.h, pins_SANGUINOLOLU_11.h and pins_RAMPS_13.h. The attached patch file contains all the changes needed to the current version 1.0.3 of Marlin.
For those wanting printing from an SD-card (I don't), it is easy to add one of these cheap SPI based micro-SD modules that can be ordered on eBay for less than 2$, since the standards SPI pins used for the SD-cards are left untouched by the OLED display. Here pictures of my test using the tiny OLED controller together with an micro-SDcard module, on both RAMPS and Sanguinololu:
I know, buying a ready made 2004 or full graphic LCD controller is so cheap today, that you won't save any money by building things yourself. But that was not my aim for this project, rather my goal was (other than the fact that I really like tinkering) to have something really small, need only a minimum of cabling, draws only little current and is also working on 3.3V...
Re: DIY Tiny OLED I2C full graphics controller September 25, 2015 07:37AM |
Registered: 10 years ago Posts: 590 |
Re: DIY Tiny OLED I2C full graphics controller September 26, 2015 04:56AM |
Registered: 11 years ago Posts: 59 |