Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. dda
    3. Best
    D
    • Continue chat with dda
    • Start new chat with dda
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups

    Best posts made by dda

    • RE: Let's speed up DrawLine and DrawPixel?

      @daslolo Yep. And I managed to integrate this to the M5Stack library. I am doing tests, but so far so good. I've run a few modified sketches without issue. The TFT_ArcFill example is quite impressive.

      Replacing the Display.h/.cpp files with the TFT_eSPI library was pretty easy. The Display library has a couple of M5-specific functions, but once added to the driver, everything works well:

      void setBrightness(uint8_t); //Specific to M5Stack
      void sleep();                //Specific to M5Stack
      

      There may be others, I'll see what happens when I compile the non-touch examples.

      posted in FAQS
      D
      dda
    • RE: Let's speed up DrawLine and DrawPixel?

      @jimit Now all we need is to have that officially included in the M5Stack library.

      posted in FAQS
      D
      dda
    • RE: Getting Longer Battery Run Time

      Nice list.

      Espressif recommends you turn off BT, ADC and WiFi yourself before going to deep sleep, as the ESP32 doesn't do it "gracefully". Something like this:

      esp_wifi_stop();
      esp_bluedroid_disable();
      esp_bluedroid_deinit();
      esp_bt_controller_disable();
      esp_bt_controller_deinit();
      esp_bt_mem_release(ESP_BT_MODE_BTDM);
      adc_power_off();
      esp_deep_sleep_start();
      posted in M5 Stick/StickC
      D
      dda
    • RE: Review "BATTERY"

      Looking at the schematics here, it looks like the IP5306 is connected to GPIO35 and 36. 2.1V each. However, in Config.h we have this definition:

      [code]#define LORA_IRQ_PIN 36[/code]

      That would conflict with the reading of the battery charge, no?

      While using LoRa, I am reading ADC1_CH7 and ADC1_CH0. Here's what I get.

      ADC1_CH7: 0 0.00
      ADC1_CH0: 346 0.71

      The value for ADC1_CH7 is always 0. The value for ADC1_CH0 goes up and down. Weird.

      posted in Lessons and Guides
      D
      dda
    • RE: Turn Off Display

      @jimit That puts the whole machine to sleep. If you want to turn only the LCD off/on, you can do M5.Lcd.setBrightness(brightness); where brightness is 100 for on and 0 for off.

      posted in FAQS
      D
      dda
    • RE: M5Stack - Simple Applications for RFID- Arduino

      #define RST_PIN 1 //Pin 1 para el reset del RC522

      As @m5stack said, PIN 1 is used by Serial0. You should pick a GPIO that's not in use already.

      posted in PROJECTS
      D
      dda
    • RE: Turn Off Display

      @dda Actually this seems to work better:

        M5.Lcd.writecommand(ILI9341_DISPOFF);
        M5.Lcd.setBrightness(0);
      

      1ILI9341_DISPOFF` doesn't turn off the backlight, just the screen itself. So by doing both, you should be saving more.

      posted in FAQS
      D
      dda
    • RE: Setting the volume

      You're supposed to call M5.Speaker.update(); after that to update the value.

      posted in FAQS
      D
      dda
    • RE: M5Stack 2 Channel Oscilloscope

      Very nice. The speaker noise issue forced me to work out a fix to shut up the speaker on demand, without having to recompile every time. Here's how: you add an end() method in Speaker.cpp:

      void SPEAKER::end() {
        ledcDetachPin(SPEAKER_PIN);
      }
      

      (declared in Speaker.h)

      class SPEAKER {
        public:
          SPEAKER(void);
          void begin();
          void end();
      

      Now you can call M5.Speaker.end(); any time to make sure the speaker shuts up. Works with any project – making it a generic solution.

      posted in PROJECTS
      D
      dda
    • RE: [Solved] ENV Hat on M5Stick-C not working at all

      Alright so after discussing this with Jimmy, turns out the ENV hat uses Wire1, not Wire, so the I2C scanner was poking in the wrong place. After fixing a couple of issues in code, it is working. Case closed :-)

      posted in Modules
      D
      dda
    • RE: M5StickC: turn off screen completely

      I poked around the APX192 code, and around a datasheet found here. First, there's this code:

      void AXP192::begin(void) {
        Wire1.begin(21, 22);
        Wire1.beginTransmission(0x34);
        Wire1.write(0x10);
        Wire1.write(0xff);  //OLED_VPP Enable
        Wire1.endTransmission();
        Wire1.beginTransmission(0x34);
        Wire1.write(0x28);
        Wire1.write(0xff); //Enable LDO2&LDO3, LED&TFT 3.3V
        Wire1.endTransmission();
      

      A peek at the datasheet says that REG 28H is power management for LD02 and LD03. Sure thing. That's what the comment in the code above says – along with a hint that LD03 is for the TFT.

      0_1564381511757_c4e39c69-4e7f-43ac-87d0-bb076edd9e54-image.png

      Meanwhile, REG 10H is two ON/OFF switches, for EXTEN and DC-DC2 – commented in the code as VPP_Enable. Bueno.

      0_1564381715507_82d5c76f-207d-421e-8db8-ac7556120001-image.png

      I am not sure which of EXTEN or DC-DC2 is connected to the OLED (both?), but turning either or both off will cut off the current to the OLED.

      Moreover there's this code later:

        Wire1.beginTransmission(0x34);
        Wire1.write(0x12);
        Wire1.write(0x4d); //Enable DC-DC1, OLED_VDD, 5B V_EXT
        Wire1.endTransmission();
      

      And REG 12H seems to do more of the same as 10H:

      0_1564381853456_5263d5e3-3e9f-48a3-9da5-f8b5f34a41b8-image.png

      Bit 3 turns ON/OFF LD03, which, as we saw above, is supposed to be the OLED. Good odds that setting bit 3 of REG 12H to zero would work too.

      I don't have time to test it now, but I'll try later tonight.

      posted in M5 Stick/StickC
      D
      dda
    • RE: M5StickC: turn off screen completely

      After a little bit of poking around I managed to turn off the screen:

      Wire1.beginTransmission(0x34);
      Wire1.write(0x12);
      Wire1.write(0b01001011);  // LDO2, aka OLED_VDD, off
      Wire1.endTransmission();
      

      This turns off LDO2, and thus the backlight. To turn it back on:

      Wire1.beginTransmission(0x34);
      Wire1.write(0x12);
      Wire1.write(0x4d); // Enable LDO2, aka OLED_VDD
      Wire1.endTransmission();
      posted in M5 Stick/StickC
      D
      dda
    • RE: M5StickC: turn off screen completely

      While I'm at it, an explanation about M5.Axp.ScreenBreath(x);. The code is:

      void AXP192::ScreenBreath(uint8_t brightness) {
        Wire1.beginTransmission(0x34);
        Wire1.write(0x28);
        Wire1.write(((brightness & 0x0f) << 4)); //Enable LDO2&LDO3, LED&TFT 3.3V
        Wire1.endTransmission();
      }
      

      What it does is it takes the value you passed, cuts it to 4 bits (0-15) and moves those 4 bits to bits 4-7. Register 28H is voltage control for LDO2 (bits 4-7) and LDO3 (bits 0-3). So the OLED is connected to LDO2.

      What that 0-15 value represents is a voltage of 1.8 to 3.3V, in 100mV/steps. So M5.Axp.ScreenBreath(0); sets voltage to 1.8V, and M5.Axp.ScreenBreath(15); to 3.3V. Not what we really want – as the goal was to set voltage to zero... :-)

      0_1564416322717_e7e8bf46-cea3-41c2-bed7-1869e4cb9146-image.png

      Whereas register 12H controls the state (ON/OFF) of a bunch of wires, including LDO2 (bit 2). Hence the code above.

      0_1564416423649_0222b6b2-3ed3-473a-9669-0020509cb215-image.png

      posted in M5 Stick/StickC
      D
      dda