Created
December 21, 2020 00:19
-
-
Save TakehikoShimojima/aba397f02ed242c92f1cdb828fa14b0e to your computer and use it in GitHub Desktop.
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
/* | |
* TFMini-SをI2Cモードからシリアルモードにする | |
*/ | |
#include <M5StickC.h> | |
#include <Wire.h> // Arduino standard I2C/Two-Wire Library | |
#include <TFMPI2C.h> // TFMini-Plus I2C Library v1.5.0 | |
TFMPI2C tfmP; // Create a TFMini-Plus I2C object | |
void setup() | |
{ | |
M5.begin(); | |
pinMode(0, INPUT_PULLUP); // SDAをプルアップする | |
pinMode(26, INPUT_PULLUP); // SCLをプルアップする | |
Wire.begin(0, 26); | |
M5.Lcd.setTextSize(2); | |
M5.Lcd.setRotation(3); | |
M5.Lcd.setCursor(10, 10); | |
M5.Lcd.print("set Serial Mode.."); | |
if (tfmP.sendCommand(SET_SERIAL_MODE, 0)) { | |
M5.Lcd.print("OK"); | |
} else { | |
M5.Lcd.print("Failed"); | |
} | |
delay(1000); | |
M5.Lcd.print("save settings.."); | |
if (tfmP.sendCommand(SAVE_SETTINGS, 0)) { | |
M5.Lcd.print("OK"); | |
} else { | |
M5.Lcd.print("Failed"); | |
} | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment