Editing
Wemos D1 Mini
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=Shields= ==lithium (LiPo) Battery shield== [[File:Battery v1.3.0 1 16x9.jpg|640px|left]]<br clear=all> <br> lithium (LiPo) Battery shield, charging & boost Specifications: {| class="wikitable" ! style="font-weight:bold;" | Features ! style="font-weight:bold;" | |- | Charging Voltage | max: 10V, recommend: 5V |- | Charging Current | max: 1A |- | Lithium Battery voltage | 3.3-4.2V |- | Boost Power Supply | 5V(max: 1A) |} <br><br> ;Pins used: {| class="wikitable" ! style="font-weight:bold;" | D1 mini ! style="font-weight:bold;" | Shield |- | 5V | 5V(max: 1A) Power Supply |- | GND | GND |} <br><br> {| class="wikitable" ! style="font-weight:bold;" | Port ! style="font-weight:bold;" | Usage |- | PH2-2.0MM (Port 1) | Connect to lithium Battery (normal 3.3-4.2V) |- | Micro USB (Port 2) | Charging port (normal 5V) |- | Green LED | lights when charging is completed |- | Red LED | lights when charging |- | J1 | setting max charging current, 0.5A or 1A. |- | J2 | Connect battery to A0 |} <br><br> [[File:Wemos Battery Shield Schematic.png|frame|left|Battery shield Schematic]]<br clear=all> {{template:top}} ==OLED Shield== [https://www.diymore.cc/collections/new-product/products/ssd1306-oled-shield-for-wemos-d1-mini-iic-i2c-iot-0-66-inch-64x48-for-arduino-compatible-module-for-wemos-d1-mini-3-3v?_pos=4&_sid=09a8137d7&_ss=r Website]<br> [[File:OLED Shield.jpg|300px]]<br clear=all> [[File:OLED Shield bottom.jpg|300px]]<br clear=all> <br> Sketch that uses this shield: <b>ssd1306_64x48_i2c-ds18b20.ino</b></br> {{template:top}} ==ssd1306 OLED display== [[File:Ssd1306 OLED.jpg|200px]]<br clear=all> ;notes<br> [http://oleddisplay.squix.ch/#/home Font converter]<br> <br> ;*NOTE- Not Tested {| class="wikitable" |- ! method ! Display Control |- | init(); | Initialize the display |- | end(); | Free the memory used by the display |- | resetDisplay(); | Cycle through the initialization |- | reconnect(); | Connect again to the display through I2C |- | displayOn(); | Turn the display on |- | displayOff(); | Turn the display offs |- | clear(); | Clear the local pixel buffer |- | display(); | Write the buffer to the display memory |- | invertDisplay(); | Inverted display mode |- | normalDisplay(); | Normal display mode |- | setContrast(contrast, precharge, comdetect); | Set display contrast. Normal=100 |- | setBrightness(int); | Convenience method to access |- | flipScreenVertically(); | Turn the display upside down |- | mirrorScreen(); | Draw the screen mirrored |} <br> {| class="wikitable" |- ! Method ! Text operations |- | drawString(x, y, String text); | Draws a String at the given location. |- | drawStringMaxWidth(x, y, maxLineWidth, String text); | Draws a String with a maximum width at the given location. |- | ugetStringWidth(const char* text, ulength); | Returns the width of the const char* with the current font settings |- | ugetStringWidth(String text); | Convencience method for the const char version |- | setTextAlignment(OLEDDISPLAY_TEXT_ALIGNMENT textAlignment); | Specifies text anchor point: TEXT_ALIGN_LEFT, TEXT_ALIGN_CENTER, TEXT_ALIGN_RIGHT, TEXT_ALIGN_CENTER_BOTH |- | setFont(const uint8_t* fontData); | Sets the current font: ArialMT_Plain_10, ArialMT_Plain_16, ArialMT_Plain_24 |} <br> {| class="wikitable" |- ! Method ! Drawing functions |- | setColor(OLEDDISPLAY_COLOR color); | Set the color of pixel operations: BLACK, WHITE, INVERSE |- | setPixel(x, y); | Draw a pixel at given position |- | drawLine(x0, y0, x1, y1); | Draw a line from position 0 to position 1 |- | drawRect(x, y, width, height); | Draw the border of a rectangle at the given location |- | fillRect(x, y, width, height); | Fill the rectangle |- | drawCircle(x, y, radius); | Draw the border of a circle |- | fillCircle(x, y, radius); | Fill circle |- | drawHorizontalLine(x, y, length); | Draw a line horizontally |- | drawVerticalLine(x, y, length); | Draw a line vertically |- | drawProgressBar(ux, uy, uwidth, uheight, progress); | Draws a rounded progress bar (0-100) with outer dimensions given by width and height. |- | drawFastImage(x, y, width, height, const *image); | Draw a bitmap in the internal image format |- | drawXbm(x, y, width, height, const char* xbm); | Draw a XBM |} <br> coding samples:<br> <nowiki>/* Reference: D:\River Documents\Arduino\Wemos\D1 Mini\OledHelloWorld Reference: https://blog.hau.me/2018/12/26/i2c-oled-display-on-a-wemos-d1-mini/ */ #include <Wire.h> #include "SSD1306.h" SSD1306 display(0x3C, D2, D1); // I2C Address, SDA and SCL pins void setup() { display.init(); display.flipScreenVertically(); display.drawString(0, 0, "Hello world"); display.display(); } void loop() { } </nowiki> <nowiki>/* This sketch demonstrates custom fonts, using a font created at: http://oleddisplay.squix.ch/#/home Reference: https://blog.hau.me/2018/12/26/i2c-oled-display-on-a-wemos-d1-mini/ */ #include <Wire.h> #include "SSD1306.h" #include "font.h" SSD1306 display(0x3C, D2, D1); // I2C address, and pins D2 (SDA/Serial Data), and D1 (SCK/Serial Clock). void setup() { display.init(); display.flipScreenVertically(); display.setFont((uint8_t *) Dialog_plain_16); // Font generated here: http://oleddisplay.squix.ch/#/home display.drawString(0, 0, "hello world-16"); display.setFont((uint8_t *) Dialog_plain_36); // Font generated here: http://oleddisplay.squix.ch/#/home display.drawString(0, 20, "XYZ-36"); display.display(); } void loop() { }</nowiki> {{template:top}}
Summary:
Please note that all contributions to Notebook may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Notebook:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Home Page
C++ Reference
ESP Hardware
ESPHome
Home Assistant
Network Stuff
Tools
What links here
Related changes
Special pages
Page information