GithubHelp home page GithubHelp logo

M5Core2 Power LED about m5unified HOT 8 OPEN

forstner-m avatar forstner-m commented on September 25, 2024
M5Core2 Power LED

from m5unified.

Comments (8)

lovyan03 avatar lovyan03 commented on September 25, 2024

Hello, @forstner-m
If the main unit type is Core2 v1.0, you can control the LED, but if it is v1.1, you cannot make detailed adjustments.
This is due to the difference in specifications between AXP192 and AXP2101.

As far as I have checked, it is working in v1.0. What model are you using?

IMG_0435.MOV

from m5unified.

forstner-m avatar forstner-m commented on September 25, 2024

I have a Core2 v1.0 and the led is not switchable. Do you have a code for this function?

from m5unified.

lovyan03 avatar lovyan03 commented on September 25, 2024

As a precaution, please update M5Unified & M5GFX library version to the latest released 0.1.13.

#include <M5Unified.h>

void setup(void)
{
  auto cfg = M5.config();
  cfg.led_brightness = 255;
  M5.begin(cfg);
}

void loop(void)
{
  M5.delay(1000);
  M5.Power.setLed(0);
  M5.delay(1000);
  M5.Power.setLed(255);
}

If this doesn't work, please show me the program you tried that works with M5Core2.h

from m5unified.

forstner-m avatar forstner-m commented on September 25, 2024

Your code works, but this do not work:

#include <Arduino.h>
#include <M5GFX.h>
#include <M5Unified.h>

M5GFX display;

void setup(void)
{
auto cfg = M5.config();
cfg.led_brightness = 255;
M5.begin(cfg);
display.begin();
}

void loop(void)
{
while(1)
{
M5.delay(1000);
M5.Power.setLed(0);
M5.delay(1000);
M5.Power.setLed(255);
}
}

If the line "display.begin();" is active the LED is off.

from m5unified.

lovyan03 avatar lovyan03 commented on September 25, 2024

M5Unified includes M5GFX.
M5.Display is an instance of M5GFX.
You must not create your own instances of M5GFX.
Examples of such code are sometimes introduced, but they should be avoided as they can cause problems.

from m5unified.

forstner-m avatar forstner-m commented on September 25, 2024

Now it works! Is the line M5.Display.begin(); necessary?
It would still be good if an example were created with canvas. But with this line it works: M5Canvas canvas(&M5.Display);

from m5unified.

lovyan03 avatar lovyan03 commented on September 25, 2024

M5.Display.begin() is not required.
This is included in M5.begin().

from m5unified.

mdxs avatar mdxs commented on September 25, 2024

This ticket can be closed as resolved.

from m5unified.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.