Hot answers tagged

3

I have solved this problem. For anyone who would like to turn off the internal pullups on the I2C bus of the ESP32, you need to disable the entire driver before putting the device to sleep. First, include the peripheral driver library from the IDF: #include "driver/periph_ctrl.h" Next, call the following before sleep: rtc_gpio_isolate(gpio_num_t(...


2

Your problem is (most likely) that you are doing everything from an interrupt. That is not only bad practice, but on Arduinos it is generally impossible. On small microcontrollers you typically only have one interrupt priority (occasionally two). That means that only one interrupt can run at a time, and if an interrupt is running then no other interrupt can ...


2

You are communicating with your OLED displays using SPI - Serial Peripheral Interface. This is a special hardware peripheral built in to the MCU, and the outputs of it are physically connected inside the MCU to what become pins 11-13 on the Arduino UNO. This, and other things like the UART, PWM and the analog inputs, are known as alternate functions of the ...


2

I was able to make it all fit by using the text-only library for the OLED. SSD1306Ascii Library Much thanks to Majenko for explaining the problem and greiman for writing the library!


1

Both the SD library and the SSD1306 libraries want big buffers. That means lots of memory. You don't have lots of memory. The SD wants at least 512 bytes for a sector buffer (which is allocated at compile time). The SSD1306 wants at least 1kiB for a display buffer (which is allocated at runtime). Serial wants at least 128 bytes for TX and RX buffers (which ...


1

Use trigonometry (sin() and cos()) functions to get the right x and y coordinates. I would consider replacing your drawLine() command with something like this (untested) assuming the tiltAngle is in degrees from -90 to +90 (with 0 degrees is straight up) and you want to draw a line at this angle from the origin (63, 63) with a radius of 64. float ...


1

Currently, you defined a forward declaration for drawLine, however I assume you want to call the method (function) inside display. So change drawLine(20,60,5,50,256); into display.drawLine(20,60,5,50,256); And you can remove the forward declaration, because this method is already defined in the library. void drawLine(uint16_t x0, uint16_t y0, uint16_t x1, ...


1

Well, one problem is this: You have made an array of pointer to function, but only initialized the first of the two, to pageECG. const int pageCount = 2; int p; void (*pages[pageCount])() = {pageECG}; The last line there roughly equivalent to: void (*pages[pageCount])() = {pageECG, nullptr}; Later in loop() you have: u8g.firstPage(); do { (*pages[...


1

NOTE: This refers to an problem in the initial posting. The question has since been edited. This may be deleted later. One problem, perhaps the problem, is that your given image appears to be 64x128 rather than 128x64: That said, I'm not sure exactly why the screen is showing precisely what it does. When you do get this showing in the correct resolution, ...


1

I had accidentally commented out the SD initialization along with the serial initialization. After uncommenting it it works correctly


1

I figured out what I was doing wrong. I was copying the name from the Constructor Reference and immediately inputting the arguments in parentheses. I needed to put u8g2 after the constructor name and then put the arguments. Thanks! The corrected code is as follows: #include <Arduino.h> #include <SPI.h> #include <U8g2lib.h> //Constructor ...


1

I just found the answer on the following site: https://lastminuteengineers.com/oled-display-arduino-tutorial/ Basically, the method startscroll* on the display takes some arguments. By passing the proper start page and stope page you can scroll parts of the screen. Refer to OLED Memory Map for explanation of the pages on the screen. There are eight pages ...


1

The SSD1306 does not handle different sizes, it's ever only handling it's maximum size 128x64. But one can decide to only use less pins of the driver for a smaller display. The SSD1306 has 128 segment pins, which activate the current column, so that the states of the 64 common signal pins will be used by the display for that column. For smaller display ...


Only top voted, non community-wiki answers of a minimum length are eligible