This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import utime | |
from sr74hc595 import SR74hc595 | |
dataPIN=8 # 74HC595 > 14 SER | |
latchPIN=6 # 74HC595 > 12 RCLK | |
clockPIN=7 # 74HC595 > 11 SRCLK | |
sr = SR74hc595(dataPIN, clockPIN, latchPIN, sr_size) | |
sr_size = 8 # 8, 16, 24... | |
bit = [0,0,0,0,0,0,0,0] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict'; | |
// Configure authentication | |
const authUser = 'user'; | |
const authPass = 'pass'; | |
exports.handler = async (event) => { | |
// Get request and request headers | |
const request = event.Records[0].cf.request; | |
const headers = request.headers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5Atom.h> | |
#define DIR_PIN 23 | |
#define STP_PIN 19 | |
#define ENL_PIN 22 | |
#define VOL_PIN 25 | |
#define DSW_PIN 21 | |
#define VOL_MAX (4095.0) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "M5Atom.h" | |
uint8_t counter = 0; | |
uint8_t line_circle[] = {2,3,9,14,19,23,22,21,15,10,5,1}; // 12 | |
uint8_t line_seq_limit = 12; | |
uint8_t line_seq_row_limit = 12; | |
uint8_t line_seq[12][12] = { | |
{1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | |
{1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}, | |
{1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "M5Atom.h" | |
uint8_t counter = 0; | |
uint8_t line1[] = {2,3,4,9,14,19,24,23,22,21,20,15,10,5,0,1}; // 16 | |
uint8_t line2[] = {7,8,13,18,17,16,11,6}; //8 | |
// ---------------- | |
void display_progress_circle() { | |
M5.dis.clear(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "M5Atom.h" | |
uint8_t counter = 0; | |
uint8_t color_index = 0; | |
const CRGB COLOR[4] = { | |
0xf00000, | |
0x00f000, | |
0x0000f0, | |
0x707070 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "M5Atom.h" | |
#include <WiFi.h> | |
#include <WiFiMulti.h> | |
#include <HTTPClient.h> | |
#include <ArduinoJson.h> | |
#define WIFI_SSID "YOUR WIFI SSID" | |
#define WIFI_PASS "YOUR WIFI PASS" | |
#define SESAME_TOKEN "YOUR API KEY" | |
#define SESAME_DEVICE_ID "YOUR SESAME ID" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5StickC.h> | |
#define DIR_PIN 26 | |
#define STEP_PIN 0 | |
/* | |
for M5Stick-C | |
*/ | |
void setup() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <MFRC522.h> | |
#include <M5Stack.h> | |
constexpr uint8_t RST_PIN = 2; | |
constexpr uint8_t SS_PIN = 5; | |
MFRC522 mfrc522(SS_PIN, RST_PIN); // Create MFRC522 instance | |
MFRC522::MIFARE_Key key; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <M5Stack.h> | |
#define PIN_SW 2 | |
void setup() { | |
M5.begin(); | |
M5.Lcd.fillScreen(BLACK); | |
pinMode(PIN_SW, INPUT_PULLUP); |
NewerOlder