GithubHelp home page GithubHelp logo

bases-node's Introduction

M5Stack Library

Arduino Lint Clang Format

English | 中文 | 日本語

The M5Stack library provides access to the built-in hardware of the M5Stack Core (including Basic and Gray) controllers.

Recommendation

This library is not recommended for new projects, nor for projects using M5Stack products other than Basic and Gray. See M5Unified and M5GFX for libraries that are more up-to-date and with support for many newer M5Stack products.

Usage

This library's functionality is available through the M5Stack class, referenced as M5, including:

  • LCD display via M5.Lcd, a customized version of the TFT_eSPI LCD library, adapted for Basic and Gray. The display resolution is 320x240 supporting 262K colors. Several fonts, graphics primitives, QR code rendering, and PNG/BMP/JPEG support are included.
  • Power control, including device shutoff and battery level detection via M5.Power and the IP5306 power management chip
  • Hardware buttons via M5.BtnA, M5.BtnB, M5.BtnC
  • Speaker, via M5.Speaker, supporting tones, volume control, and basic wave audio playback using ESP32's DAC function
  • Accelerometer, via M5.Imu, M5.Mpu6886, or M5.Sh200Q (accelerometer type depends on version of Basic/Gray)

To use the M5Stack library, #include "M5Stack.h" must appear at the top of your sketch.

The most productive way to become acquainted with the class is through the numerous included examples. Additional documentation within this library:

Additional optional include files:

  • M5Faces.h for access to M5Stack Faces accessories (EOL)
  • LoRaWan.h

basicgray

Comparison of M5Stack controllers

M-BUS

More Information

UIFlow Quick Start: Click Here

MicroPython API: Click Here

Arduino IDE Development: Click Here

Gray PinMap: Click Here

Basic PinMap: v1.0 (EOL) v2.6 (EOL) v2.7**

USER CASES

bases-node's People

Contributors

graydonli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bases-node's Issues

I2S_DOUT and I2S_DIN wrong pin numbers?

It seems that the pin numbers for I2S_DOUT and I2S_DIN are labeled wrong in the README.md.

The following code runs fine, but with reversed I2S_DOUT and I2S_DIN numbers.

// M5Stack Node pins https://github.com/m5stack/Bases-Node
// https://github.com/jmysu/ESP32_VU/blob/master/PlatformIO/ESP32_WM8978I2S/src/_mainMP3.cpp

#define I2C_SDA  21
#define I2C_SCL  22

/* M5Stack Node WM8978 pins */ 
//      codec pin    esp32 pin
#define I2S_BCK      5
#define I2S_WS      13
#define I2S_DOUT     2    /* DIN and DOUT are labeled wrong? */
#define I2S_DIN     34    /* DIN and DOUT are labeled wrong? */
#define I2S_CLK      0

#include "Audio.h"  // https://github.com/schreibfaul1/ESP32-audioI2S
#include "WM8978.h"
#include "I2S.h"

Audio audio;

void setup() {
  WiFi.begin("xxx", "xxx");
  while (!WiFi.isConnected()) {
    delay(10);
  }
  ESP_LOGI(TAG, "Connected");

  wm8978Setup(I2C_SDA, I2C_SCL);
  WM8978_SPKvol_Set(32); /* max 63? */
  WM8978_HPvol_Set(32,32);

  PIN_FUNC_SELECT(PERIPHS_IO_MUX_GPIO0_U, FUNC_GPIO0_CLK_OUT1);
  REG_WRITE(PIN_CTRL, 0xFFFFFFF0);
  //REG_WRITE(PIN_CTRL, 0);
  audio.setPinout(I2S_BCK, I2S_WS, I2S_DOUT);

  ESP_LOGI(TAG, "Starting MP3...\n");
  audio.connecttohost("http://icecast.omroep.nl/3fm-bb-mp3");
}

void loop() {
  audio.loop();
  //delay(2);
}

If I put in the pin numbers from the readme, the sketch won't produce any sound and complains about pin assignment.

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.