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
// TAMIYA マイコンロボット工作セット (クローラータイプ) | |
// M5AtomS3 でコントロールするサンプル | |
#include "M5AtomS3.h" | |
#include "Wire.h" | |
const uint8_t SonnerAddr = 0x2C ; | |
const int PWMCH_R = 0; // 右モーターのPWMチャンネル | |
const int PWMCH_L = 1; // 左モーターのPWMチャンネル | |
const int PIN_R = 5; // 右モーター | |
const int PIN_L = 6; // 左モーター |
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 "M5AtomS3.h" | |
// M5Atomとmicro:bitエッジコネクタの対応 | |
#define MB_PIN1 7 | |
#define MB_PIN2 8 | |
#define MB_PIN12 1 | |
#define MB_PIN13 5 | |
#define MB_PIN14 6 | |
#define MB_PIN15 39 | |
#define MB_PIN16 38 |
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
// 改造FOLO(M5Samp PICO)用 ベーススケッチ | |
// コレをベースに機能を付け足していく予定 | |
int mode = 0 ; | |
const int BTN = 36 ; | |
// 目玉用LED | |
const int LED_R = 3 ; | |
const int LED_L = 1 ; |
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
const int rs=2,rw=3,en=4 ; | |
int lcdPin[] = {10,11,12,13} ; | |
// make some custom characters: | |
byte heart[8] = { 0b00000, 0b01010, 0b11111, 0b11111, 0b11111, 0b01110, 0b00100, 0b00000}; | |
byte checkFig[8]={ 0b00001, 0b00011, 0b00111, 0b01111, 0b11111, 0b00100, 0b00010, 0b00001}; | |
void lcdCommand(uint8_t value , uint8_t mode=LOW) { | |
digitalWrite(rs, mode); | |
digitalWrite(rw, LOW); |
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
// Sample sketch for operating the stepping motor 28BYJ-48 and motor driver UKN2003A using the Arduino standard library | |
#include <Stepper.h> | |
#define PIN_BLUE 4 | |
#define PIN_PINK 5 | |
#define PIN_YELLOW 6 | |
#define PIN_ORANGE 7 | |
#define MOTOR_STEPS (2048) | |
Stepper stepper(MOTOR_STEPS, PIN_BLUE, PIN_YELLOW, PIN_PINK, PIN_ORANGE); | |
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
// Sample to operate 4-digit 7-segment LED with HT16K33 | |
#include <Wire.h> | |
#define HT16K33_ADDR 0x70 | |
#define SEG_0 0b00111111 | |
#define SEG_1 0b00000110 | |
#define SEG_2 0b01011011 | |
#define SEG_3 0b01001111 | |
#define SEG_4 0b01100110 |
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 <M5StickCPlus.h> | |
#include <driver/i2s.h> | |
// --- I2S MIC address and command | |
#define PIN_CLK 0 | |
#define PIN_DATA 34 | |
#define SAMPLE_RATE 44100 | |
#define DATA_POINTS 128 | |
#define READ_LEN (2 * DATA_POINTS) | |
uint8_t BUFFER[READ_LEN] = {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
/** | |
* 静電容量式レインセンサー for M5Stamp | |
* 雨が降ったらLINEに通知 | |
*/ | |
#include <WiFi.h> | |
#include <WiFiClientSecure.h> | |
#define DEBUG true // true:OLED SSD1307 表示 | |
#if DEBUG |
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
// 温湿度センサー AM2301B I2C アクセステスト | |
#include <Wire.h> | |
#define BAUDRATE 9600 | |
#define AM2301BADDR 0x38 | |
// ----- Senser Data | |
struct AM2301B_s { | |
int humidity ; // 湿度 | |
float temperature; // 温度 | |
} am2301b ; |
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
// TOUCH PANEL TEST | |
#include <SPI.h> | |
#define TFT_CLK 13 | |
#define TFT_MOSI 12 | |
#define TFT_MISO 11 | |
#define TFT_CS 7 | |
#define CMD_RDX 0XD0 | |
#define CMD_RDY 0X90 |