Skip to content

Black display when using setcursor() even when changing fontsizes from 1 to 7 #57

@linxcow

Description

@linxcow

Describe the bug

Using following code after installing m5stickcplus 0.1.0 i get always black display.
I also note in my other projects that using setCursor(0, 0, x) to change font or size values between 1 and 7 some dont show any display at all , why is that?

      `
      void loop() {
          tftSprite.fillSprite(BLACK);   // Fill the canvas with black.                         
          tftSprite.setCursor(0, 0, 1);  // Set the cursor position and use the 1-point font.
          tftSprite.printf("AXP Temp: %.1fC \r\n",
                           M5.Axp.GetTempInAXP192());  // Get the temperature of AXP192.
                           
          tftSprite.printf("Bat: %.3fv %.1fma\r\n",
                           M5.Axp.GetBatVoltage(),
                           M5.Axp.GetBatCurrent());  // Output voltage and current of // Bat.
                                                     
          tftSprite.printf("Usb: %.2fv %.1fma\r\n",
                           M5.Axp.GetVBusVoltage(),
                           M5.Axp.GetVBusCurrent());  // Output current and voltage of USB
                                                      
          tftSprite.printf("5V-In: %.2fv %.1fma\r\n",
            M5.Axp.GetVinVoltage(), M5.Axp.GetVinCurrent());
          tftSprite.printf("Bat power %.1fmw", M5.Axp.GetBatPower());
          tftSprite.pushSprite(2, 2);   // Where to place our sprite ( 2 pixel marge for best display )
      
          // 0x01 long press(1s), 0x02 press
          // No display or flashing with next line ???
          // if (M5.Axp.GetBtnPress() == 0x02)  { esp_restart(); }  // Restart when powerbutton is pressed shortly
      
          if (M5.BtnA.wasPressed()) {  // When Main button pressed powerdown LCD & Backlight 
            M5.Axp.SetLDO2(false);
          } 
          else if (M5.BtnB.wasPressed()) { // When bottom button pressed powerup LCD & Backlight 
            M5.Axp.SetLDO2(true);
          }
          M5.update();  // Detect whether the keystroke state has changed.
          delay(100);
      }`

To reproduce

use code above in arduino version above

Expected behavior

Arduino ide 1.8.19

Screenshots

No response

Environment

  • OS:
  • IDE &IDE Version:
  • Repository Version:

Additional context

No response

Issue checklist

  • I searched for previous reports in the issue tracker
  • My report contains all necessary details

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions