Skip to content

Commit

Permalink
Merge branch 'master' of github.com:m5stack/M5Atom
Browse files Browse the repository at this point in the history
  • Loading branch information
Gitshaoxiang committed Aug 10, 2023
2 parents 7491ff1 + e1f2cb9 commit 2f35b6a
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 30 deletions.
Empty file modified .github/actions/arduino-test-compile.sh
100644 → 100755
Empty file.
2 changes: 1 addition & 1 deletion .github/workflows/arduino-action-atom-compile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,6 @@ jobs:
sketches-exclude: ${{ matrix.sketches-exclude }}
build-properties: ${{ toJson(matrix.build-properties) }}
sketch-names: "*.ino"
sketch-names-find-start: "examples/*"
sketch-names-find-start: "*"
debug-compile: true
debug-install: true
2 changes: 1 addition & 1 deletion examples/Advanced/WIFI/BasicHttpClient/BasicHttpClient.ino
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ WiFiMulti wifiMulti;
HTTPClient http;

void setup() {
M5.begin(); // Init M5Atom. 初始化 M5Atom
M5.begin(); // Init M5Atom. 初始化 M5Atom
wifiMulti.addAP("YOUR-WIFINAME",
"YOUR_WIFIPASSWORD"); // Storage wifi configuration
// information. 存储wifi配置信息
Expand Down
44 changes: 21 additions & 23 deletions examples/Basics/FactoryTest/ATOM_LITE/ATOM_LITE.ino
Original file line number Diff line number Diff line change
Expand Up @@ -8,43 +8,41 @@ Adafruit_NeoPixel pixels = Adafruit_NeoPixel(
NUMPIXELS, PIN,
NEO_GRB + NEO_KHZ800); // set number of LEDs, pin number, LED type.
// 设置灯的数量,控制引脚编号,灯灯类型

void setup() {
M5.begin(); // Init M5Atom. 初始化 M5Atom
pixels.begin(); // Init the NeoPixel library. 初始化NeoPixel库

}

void loop() {
rainbow(20);
}


void rainbow(uint8_t wait) {
uint16_t i, j;

for(j=0; j<256; j++) {
for(i=0; i<pixels.numPixels(); i++) {
pixels.setPixelColor(i, Wheel((i+j) & 255));
while(M5.Btn.read()== 1);
uint16_t i, j;

for (j = 0; j < 256; j++) {
for (i = 0; i < pixels.numPixels(); i++) {
pixels.setPixelColor(i, Wheel((i + j) & 255));
while (M5.Btn.read() == 1)
;
}
pixels.show();
delay(wait);
}
pixels.show();
delay(wait);
}
}


// Input a value 0 to 255 to get a color value.
// The colours are a transition r - g - b - back to r.
uint32_t Wheel(byte WheelPos) {
WheelPos = 255 - WheelPos;
if(WheelPos < 85) {
return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if(WheelPos < 170) {
WheelPos -= 85;
return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
WheelPos = 255 - WheelPos;
if (WheelPos < 85) {
return pixels.Color(255 - WheelPos * 3, 0, WheelPos * 3);
}
if (WheelPos < 170) {
WheelPos -= 85;
return pixels.Color(0, WheelPos * 3, 255 - WheelPos * 3);
}
WheelPos -= 170;
return pixels.Color(WheelPos * 3, 255 - WheelPos * 3, 0);
}
10 changes: 7 additions & 3 deletions examples/Basics/SpiritLevel/SpiritLevel.ino
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@
* 获取更多资料请访问:https://docs.m5stack.com/zh_CN/core/atom_matrix
*
* Describe: SpiritLevel
* Date: 2021/7/21
* Date: 2023/8/5
*******************************************************************************
Shake the M5Atom and the matrix light will change with the position, you can
set a new reference point by pressing the button.
晃动M5Atom,矩阵灯将会随着位置的变化而变化,你可以通过按下按键来设定新的基准点位
*/
#include "M5Atom.h"

Expand Down Expand Up @@ -39,6 +42,7 @@ The loop() function is an infinite loop in which the program runs repeatedly
在setup()函数中的程序执行完后,会接着执行loop()函数中的程序
loop()函数是一个死循环,其中的程序会不断的重复运行 */
void loop() {
M5.update();
static float offX = 0., offY = 0.;
static float smoX = 0., smoY = 0.;

Expand All @@ -53,8 +57,8 @@ void loop() {
smoY = ALPHA * accY + BETA * smoY;

if (M5.Btn.wasPressed()) { // Check if the key is pressed. 判断按键是否按下
offX = smoX;
offY = smoY;
offX = smoX; // Set the current position as the reference point.
offY = smoY; // 设定当前位置为基准点位
}

float xc = (offX - smoX) * SENSITIVITY + 2.0;
Expand Down
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ category=Device Control
url=https://github.com/m5stack/M5Atom
architectures=esp32
includes=M5Atom.h
depends=M5Family,ATOM_DTU_CAT1,ATOM-ECHO,M5-Ethernet
depends=M5Family,ATOM_DTU_CAT1
2 changes: 1 addition & 1 deletion src/utility/LED_DisPlay.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class LED_DisPlay : public Task {
int32_t _am_count = -1;
uint8_t *_am_buffptr;
uint16_t _yRows = 5;
uint16_t _xColumns = 6;
uint16_t _xColumns = 5;

SemaphoreHandle_t _xSemaphore = NULL;

Expand Down

0 comments on commit 2f35b6a

Please sign in to comment.