diff --git a/M5StickCPlus_FactoryTest2022.ino b/M5StickCPlus_FactoryTest2022.ino index 9dbd118..81c4b48 100644 --- a/M5StickCPlus_FactoryTest2022.ino +++ b/M5StickCPlus_FactoryTest2022.ino @@ -1591,7 +1591,7 @@ #ifdef ENABLE_OTA const char *ssid = "miura2g"; -const char *password = "jikken2024"; +const char *password = "jikkenICS"; void OTA_Setup() { WiFi.softAPdisconnect(true); diff --git a/SampleSrc/TestBuild/Adafruit_SGP30.cpp b/SampleSrc/TestBuild/Adafruit_SGP30.cpp new file mode 100644 index 0000000..79e0020 --- /dev/null +++ b/SampleSrc/TestBuild/Adafruit_SGP30.cpp @@ -0,0 +1,280 @@ +/*! + * @file Adafruit_SGP30.cpp + * + * @mainpage Adafruit SGP30 gas sensor driver + * + * @section intro_sec Introduction + * + * This is the documentation for Adafruit's SGP30 driver for the + * Arduino platform. It is designed specifically to work with the + * Adafruit SGP30 breakout: http://www.adafruit.com/products/3709 + * + * These sensors use I2C to communicate, 2 pins (SCL+SDA) are required + * to interface with the breakout. + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * + * @section author Author + * Written by Ladyada for Adafruit Industries. + * + * @section license License + * BSD license, all text here must be included in any redistribution. + * + */ + +#include "Adafruit_SGP30.h" +#include "Arduino.h" + +/*! + * @brief Instantiates a new SGP30 class + */ +Adafruit_SGP30::Adafruit_SGP30() {} + +/*! + * @brief Setups the hardware and detects a valid SGP30. Initializes I2C + * then reads the serialnumber and checks that we are talking to an + * SGP30 + * @param theWire + * Optional pointer to I2C interface, otherwise use Wire + * @param initSensor + * Optional pointer to prevent IAQinit to be called. Used for Deep + * Sleep. + * @return True if SGP30 found on I2C, False if something went wrong! + */ +boolean Adafruit_SGP30::begin(TwoWire *theWire, boolean initSensor) { + if (i2c_dev) { + delete i2c_dev; // remove old interface + } + + i2c_dev = new Adafruit_I2CDevice(SGP30_I2CADDR_DEFAULT, theWire); + + if (!i2c_dev->begin()) { + return false; + } + + uint8_t command[2]; + command[0] = 0x36; + command[1] = 0x82; + if (!readWordFromCommand(command, 2, 10, serialnumber, 3)) + return false; + + uint16_t featureset; + command[0] = 0x20; + command[1] = 0x2F; + if (!readWordFromCommand(command, 2, 10, &featureset, 1)) + return false; + // Serial.print("Featureset 0x"); Serial.println(featureset, HEX); + if ((featureset & 0xF0) != SGP30_FEATURESET) + return false; + if (initSensor) { + if (!IAQinit()) + return false; + } + + return true; +} + +/*! + * @brief Commands the sensor to perform a soft reset using the "General + * Call" mode. Take note that this is not sensor specific and all devices that + * support the General Call mode on the on the same I2C bus will perform this. + * + * @return True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::softReset(void) { + uint8_t command[2]; + command[0] = 0x00; + command[1] = 0x06; + return readWordFromCommand(command, 2, 10); +} + +/*! + * @brief Commands the sensor to begin the IAQ algorithm. Must be called + * after startup. + * @returns True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::IAQinit(void) { + uint8_t command[2]; + command[0] = 0x20; + command[1] = 0x03; + return readWordFromCommand(command, 2, 10); +} + +/*! + * @brief Commands the sensor to take a single eCO2/VOC measurement. Places + * results in {@link TVOC} and {@link eCO2} + * @return True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::IAQmeasure(void) { + uint8_t command[2]; + command[0] = 0x20; + command[1] = 0x08; + uint16_t reply[2]; + if (!readWordFromCommand(command, 2, 12, reply, 2)) + return false; + TVOC = reply[1]; + eCO2 = reply[0]; + return true; +} + +/*! + * @brief Commands the sensor to take a single H2/ethanol raw measurement. + * Places results in {@link rawH2} and {@link rawEthanol} + * @returns True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::IAQmeasureRaw(void) { + uint8_t command[2]; + command[0] = 0x20; + command[1] = 0x50; + uint16_t reply[2]; + if (!readWordFromCommand(command, 2, 25, reply, 2)) + return false; + rawEthanol = reply[1]; + rawH2 = reply[0]; + return true; +} + +/*! + * @brief Request baseline calibration values for both CO2 and TVOC IAQ + * calculations. Places results in parameter memory locaitons. + * @param eco2_base + * A pointer to a uint16_t which we will save the calibration + * value to + * @param tvoc_base + * A pointer to a uint16_t which we will save the calibration value to + * @return True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::getIAQBaseline(uint16_t *eco2_base, + uint16_t *tvoc_base) { + uint8_t command[2]; + command[0] = 0x20; + command[1] = 0x15; + uint16_t reply[2]; + if (!readWordFromCommand(command, 2, 10, reply, 2)) + return false; + *eco2_base = reply[0]; + *tvoc_base = reply[1]; + return true; +} + +/*! + * @brief Assign baseline calibration values for both CO2 and TVOC IAQ + * calculations. + * @param eco2_base + * A uint16_t which we will save the calibration value from + * @param tvoc_base + * A uint16_t which we will save the calibration value from + * @return True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base) { + uint8_t command[8]; + command[0] = 0x20; + command[1] = 0x1e; + command[2] = tvoc_base >> 8; + command[3] = tvoc_base & 0xFF; + command[4] = generateCRC(command + 2, 2); + command[5] = eco2_base >> 8; + command[6] = eco2_base & 0xFF; + command[7] = generateCRC(command + 5, 2); + + return readWordFromCommand(command, 8, 10); +} + +/*! + * @brief Set the absolute humidity value [mg/m^3] for compensation to + * increase precision of TVOC and eCO2. + * @param absolute_humidity + * A uint32_t [mg/m^3] which we will be used for compensation. + * If the absolute humidity is set to zero, humidity compensation + * will be disabled. + * @return True if command completed successfully, false if something went + * wrong! + */ +boolean Adafruit_SGP30::setHumidity(uint32_t absolute_humidity) { + if (absolute_humidity > 256000) { + return false; + } + + uint16_t ah_scaled = + (uint16_t)(((uint64_t)absolute_humidity * 256 * 16777) >> 24); + uint8_t command[5]; + command[0] = 0x20; + command[1] = 0x61; + command[2] = ah_scaled >> 8; + command[3] = ah_scaled & 0xFF; + command[4] = generateCRC(command + 2, 2); + + return readWordFromCommand(command, 5, 10); +} + +/*! + * @brief I2C low level interfacing + */ + +bool Adafruit_SGP30::readWordFromCommand(uint8_t command[], + uint8_t commandLength, + uint16_t delayms, uint16_t *readdata, + uint8_t readlen) { + + if (!i2c_dev->write(command, commandLength)) { + return false; + } + + delay(delayms); + + if (readlen == 0) + return true; + + uint8_t replylen = readlen * (SGP30_WORD_LEN + 1); + uint8_t replybuffer[replylen]; + + if (!i2c_dev->read(replybuffer, replylen)) { + return false; + } + + for (uint8_t i = 0; i < readlen; i++) { + uint8_t crc = generateCRC(replybuffer + i * 3, 2); +#ifdef I2C_DEBUG + Serial.print("\t\tCRC calced: 0x"); + Serial.print(crc, HEX); + Serial.print(" vs. 0x"); + Serial.println(replybuffer[i * 3 + 2], HEX); +#endif + if (crc != replybuffer[i * 3 + 2]) + return false; + // success! store it + readdata[i] = replybuffer[i * 3]; + readdata[i] <<= 8; + readdata[i] |= replybuffer[i * 3 + 1]; +#ifdef I2C_DEBUG + Serial.print("\t\tRead: 0x"); + Serial.println(readdata[i], HEX); +#endif + } + return true; +} + +uint8_t Adafruit_SGP30::generateCRC(uint8_t *data, uint8_t datalen) { + // calculates 8-Bit checksum with given polynomial + uint8_t crc = SGP30_CRC8_INIT; + + for (uint8_t i = 0; i < datalen; i++) { + crc ^= data[i]; + for (uint8_t b = 0; b < 8; b++) { + if (crc & 0x80) + crc = (crc << 1) ^ SGP30_CRC8_POLYNOMIAL; + else + crc <<= 1; + } + } + return crc; +} diff --git a/SampleSrc/TestBuild/Adafruit_SGP30.h b/SampleSrc/TestBuild/Adafruit_SGP30.h new file mode 100644 index 0000000..1e309f9 --- /dev/null +++ b/SampleSrc/TestBuild/Adafruit_SGP30.h @@ -0,0 +1,83 @@ +/*! + * @file Adafruit_SGP30.h + * + * This is the documentation for Adafruit's SGP30 driver for the + * Arduino platform. It is designed specifically to work with the + * Adafruit SGP30 breakout: http://www.adafruit.com/products/3709 + * + * These sensors use I2C to communicate, 2 pins (SCL+SDA) are required + * to interface with the breakout. + * + * Adafruit invests time and resources providing this open source code, + * please support Adafruit and open-source hardware by purchasing + * products from Adafruit! + * + * Written by Ladyada for Adafruit Industries. + * + * BSD license, all text here must be included in any redistribution. + * + */ + +#ifndef ADAFRUIT_SGP30_H +#define ADAFRUIT_SGP30_H + +#include "Arduino.h" +#include +#include + +// the i2c address +#define SGP30_I2CADDR_DEFAULT 0x58 ///< SGP30 has only one I2C address + +// commands and constants +#define SGP30_FEATURESET 0x0020 ///< The required set for this library +#define SGP30_CRC8_POLYNOMIAL 0x31 ///< Seed for SGP30's CRC polynomial +#define SGP30_CRC8_INIT 0xFF ///< Init value for CRC +#define SGP30_WORD_LEN 2 ///< 2 bytes per word + +/*! + * @brief Class that stores state and functions for interacting with + * SGP30 Gas Sensor + */ +class Adafruit_SGP30 { +public: + Adafruit_SGP30(); + boolean begin(TwoWire *theWire = &Wire, boolean initSensor = true); + boolean softReset(); + boolean IAQinit(); + boolean IAQmeasure(); + boolean IAQmeasureRaw(); + + boolean getIAQBaseline(uint16_t *eco2_base, uint16_t *tvoc_base); + boolean setIAQBaseline(uint16_t eco2_base, uint16_t tvoc_base); + boolean setHumidity(uint32_t absolute_humidity); + + /** The last measurement of the IAQ-calculated Total Volatile Organic + * Compounds in ppb. This value is set when you call {@link IAQmeasure()} **/ + uint16_t TVOC; + + /** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This + * value is set when you call {@link IAQmeasure()} **/ + uint16_t eCO2; + + /** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This + * value is set when you call {@link IAQmeasureRaw()} **/ + uint16_t rawH2; + + /** The last measurement of the IAQ-calculated equivalent CO2 in ppm. This + * value is set when you call {@link IAQmeasureRaw()} **/ + uint16_t rawEthanol; + + /** The 48-bit serial number, this value is set when you call {@link begin()} + * **/ + uint16_t serialnumber[3]; + +private: + Adafruit_I2CDevice *i2c_dev = NULL; ///< Pointer to I2C bus interface + void write(uint8_t address, uint8_t *data, uint8_t n); + void read(uint8_t address, uint8_t *data, uint8_t n); + bool readWordFromCommand(uint8_t command[], uint8_t commandLength, + uint16_t delay, uint16_t *readdata = NULL, + uint8_t readlen = 0); + uint8_t generateCRC(uint8_t data[], uint8_t datalen); +}; +#endif // ndef ADAFRUIT_SGP30_H diff --git a/SampleSrc/TestBuild/SparkFunCCS811.cpp b/SampleSrc/TestBuild/SparkFunCCS811.cpp new file mode 100644 index 0000000..c793ae4 --- /dev/null +++ b/SampleSrc/TestBuild/SparkFunCCS811.cpp @@ -0,0 +1,612 @@ +/****************************************************************************** +SparkFunCCS811.cpp +CCS811 Arduino library + +Marshall Taylor @ SparkFun Electronics +Nathan Seidle @ SparkFun Electronics + +April 4, 2017 + +https://github.com/sparkfun/CCS811_Air_Quality_Breakout +https://github.com/sparkfun/SparkFun_CCS811_Arduino_Library + +Resources: +Uses Wire.h for i2c operation + +Development environment specifics: +Arduino IDE 1.8.1 + +This code is released under the [MIT License](http://opensource.org/licenses/MIT). + +Please review the LICENSE.md file included with this example. If you have any questions +or concerns with licensing, please contact techsupport@sparkfun.com. + +Distributed as-is; no warranty is given. +******************************************************************************/ + +//See SparkFunCCS811.h for additional topology notes. + +#include "SparkFunCCS811.h" +#include "stdint.h" + +#include +#include "Wire.h" +#include + +//****************************************************************************// +// +// CCS811Core functions +// +// Default
is 0x5B. +// +//****************************************************************************// +CCS811Core::CCS811Core(uint8_t inputArg) : I2CAddress(inputArg) +{ +} + +CCS811Core::CCS811_Status_e CCS811Core::beginCore(TwoWire &wirePort) +{ + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; + + _i2cPort = &wirePort; //Pull in user's choice of I2C hardware + + //Wire.begin(); //See issue 13 https://github.com/sparkfun/SparkFun_CCS811_Arduino_Library/issues/13 + +#ifdef __AVR__ +#endif + +#ifdef __MK20DX256__ +#endif + +#if defined(ARDUINO_ARCH_ESP8266) + _i2cPort->setClockStretchLimit(200000); // was default 230 uS, now 200ms +#endif + + //Spin for a few ms + volatile uint8_t temp = 0; + for (uint16_t i = 0; i < 10000; i++) + { + temp++; + } + + //Check the ID register to determine if the operation was a success. + uint8_t readCheck; + readCheck = 0; + returnError = readRegister(CSS811_HW_ID, &readCheck); + + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + + if (readCheck != 0x81) + { + returnError = CCS811_Stat_ID_ERROR; + } + + return returnError; +} + +//****************************************************************************// +// +// ReadRegister +// +// Parameters: +// offset -- register to read +// *outputPointer -- Pass &variable (address of) to save read data to +// +//****************************************************************************// +CCS811Core::CCS811_Status_e CCS811Core::readRegister(uint8_t offset, uint8_t *outputPointer) +{ + //Return value + uint8_t numBytes = 1; + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; + + _i2cPort->beginTransmission(I2CAddress); + _i2cPort->write(offset); + if (_i2cPort->endTransmission() != 0) + { + returnError = CCS811_Stat_I2C_ERROR; + } + + _i2cPort->requestFrom(I2CAddress, numBytes); + *outputPointer = _i2cPort->read(); // receive a byte as a proper uint8_t + + return returnError; +} + +//****************************************************************************// +// +// multiReadRegister +// +// Parameters: +// offset -- register to read +// *outputPointer -- Pass &variable (base address of) to save read data to +// length -- number of bytes to read +// +// Note: Does not know if the target memory space is an array or not, or +// if there is the array is big enough. if the variable passed is only +// two bytes long and 3 bytes are requested, this will over-write some +// other memory! +// +//****************************************************************************// +CCS811Core::CCS811_Status_e CCS811Core::multiReadRegister(uint8_t offset, uint8_t *outputPointer, uint8_t length) +{ + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; + + //define pointer that will point to the external space + uint8_t i = 0; + uint8_t c = 0; + //Set the address + _i2cPort->beginTransmission(I2CAddress); + _i2cPort->write(offset); + if (_i2cPort->endTransmission() != 0) + { + returnError = CCS811_Stat_I2C_ERROR; + } + else //OK, all worked, keep going + { + // request 6 bytes from slave device + _i2cPort->requestFrom(I2CAddress, length); + while ((_i2cPort->available()) && (i < length)) // slave may send less than requested + { + c = _i2cPort->read(); // receive a byte as character + *outputPointer = c; + outputPointer++; + i++; + } + } + + return returnError; +} + +//****************************************************************************// +// +// writeRegister +// +// Parameters: +// offset -- register to write +// dataToWrite -- 8 bit data to write to register +// +//****************************************************************************// +CCS811Core::CCS811_Status_e CCS811Core::writeRegister(uint8_t offset, uint8_t dataToWrite) +{ + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; + + _i2cPort->beginTransmission(I2CAddress); + _i2cPort->write(offset); + _i2cPort->write(dataToWrite); + if (_i2cPort->endTransmission() != 0) + { + returnError = CCS811_Stat_I2C_ERROR; + } + return returnError; +} + +//****************************************************************************// +// +// multiReadRegister +// +// Parameters: +// offset -- register to read +// *inputPointer -- Pass &variable (base address of) to save read data to +// length -- number of bytes to read +// +// Note: Does not know if the target memory space is an array or not, or +// if there is the array is big enough. if the variable passed is only +// two bytes long and 3 bytes are requested, this will over-write some +// other memory! +// +//****************************************************************************// +CCS811Core::CCS811_Status_e CCS811Core::multiWriteRegister(uint8_t offset, uint8_t *inputPointer, uint8_t length) +{ + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; + //define pointer that will point to the external space + uint8_t i = 0; + //Set the address + _i2cPort->beginTransmission(I2CAddress); + _i2cPort->write(offset); + while (i < length) // send data bytes + { + _i2cPort->write(*inputPointer); // receive a byte as character + inputPointer++; + i++; + } + if (_i2cPort->endTransmission() != 0) + { + returnError = CCS811_Stat_I2C_ERROR; + } + return returnError; +} + +//****************************************************************************// +// +// Main user class -- wrapper for the core class + maths +// +// Construct with same rules as the core ( uint8_t busType, uint8_t inputArg ) +// +//****************************************************************************// +CCS811::CCS811(uint8_t inputArg) : CCS811Core(inputArg) +{ + refResistance = 10000; //Unsupported feature. + resistance = 0; //Unsupported feature. + temperature = 0; + tVOC = 0; + CO2 = 0; +} + +CCS811::CCS811() : CCS811(0){} +//****************************************************************************// +// +// Begin +// +// This starts the lower level begin, then applies settings +// +//****************************************************************************// +bool CCS811::begin(TwoWire &wirePort) +{ + if (beginWithStatus(wirePort) == CCS811_Stat_SUCCESS) + return true; + return false; +} + +//****************************************************************************// +// +// Begin +// +// This starts the lower level begin, then applies settings +// +//****************************************************************************// +CCS811Core::CCS811_Status_e CCS811::beginWithStatus(TwoWire &wirePort) +{ + uint8_t data[4] = {0x11, 0xE5, 0x72, 0x8A}; //Reset key + CCS811Core::CCS811_Status_e returnError = CCS811_Stat_SUCCESS; //Default error state + + //restart the core + returnError = beginCore(wirePort); + + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + + //Reset the device + multiWriteRegister(CSS811_SW_RESET, data, 4); + + //Tclk = 1/16MHz = 0x0000000625 + //0.001 s / tclk = 16000 counts + volatile uint8_t temp = 0; + +#ifdef ARDUINO_ARCH_ESP32 + for (uint32_t i = 0; i < 80000; i++) //This waits > 1ms @ 80MHz clock + { + temp++; + } +#elif __AVR__ + for (uint16_t i = 0; i < 16000; i++) //This waits > 1ms @ 16MHz clock + { + temp++; + } +#else + for (uint32_t i = 0; i < 200000; i++) //Spin for a good while + { + temp++; + } +#endif + + if (checkForStatusError() == true) + return CCS811_Stat_INTERNAL_ERROR; + + if (appValid() == false) + return CCS811_Stat_INTERNAL_ERROR; + + //Write 0 bytes to this register to start app + _i2cPort->beginTransmission(I2CAddress); + _i2cPort->write(CSS811_APP_START); + if (_i2cPort->endTransmission() != 0) + { + return CCS811_Stat_I2C_ERROR; + } + + //Added from issue 6 + // Without a delay here, the CCS811 and I2C can be put in a bad state. + // Seems to work with 50us delay, but make a bit longer to be sure. +#if defined(ARDUINO_ARCH_ESP32) || defined(ARDUINO_ARCH_ESP8266) + delayMicroseconds(100); +#endif + + returnError = setDriveMode(1); //Read every second + + return returnError; +} + +//****************************************************************************// +// +// Sensor functions +// +//****************************************************************************// +//Updates the total voltatile organic compounds (TVOC) in parts per billion (PPB) +//and the CO2 value +//Returns nothing +CCS811Core::CCS811_Status_e CCS811::readAlgorithmResults(void) +{ + uint8_t data[4]; + CCS811Core::CCS811_Status_e returnError = multiReadRegister(CSS811_ALG_RESULT_DATA, data, 4); + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + // Data ordered: + // co2MSB, co2LSB, tvocMSB, tvocLSB + + CO2 = ((uint16_t)data[0] << 8) | data[1]; + tVOC = ((uint16_t)data[2] << 8) | data[3]; + return CCS811_Stat_SUCCESS; +} + +//Checks to see if error bit is set +bool CCS811::checkForStatusError(void) +{ + uint8_t value; + //return the status bit + readRegister(CSS811_STATUS, &value); + return (value & 1 << 0); +} + +//Checks to see if DATA_READ flag is set in the status register +bool CCS811::dataAvailable(void) +{ + uint8_t value; + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_STATUS, &value); + if (returnError != CCS811_Stat_SUCCESS) + { + return 0; + } + else + { + return (value & 1 << 3); + } +} + +//Checks to see if APP_VALID flag is set in the status register +bool CCS811::appValid(void) +{ + uint8_t value; + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_STATUS, &value); + if (returnError != CCS811_Stat_SUCCESS) + { + return 0; + } + else + { + return (value & 1 << 4); + } +} + +uint8_t CCS811::getErrorRegister(void) +{ + uint8_t value; + + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_ERROR_ID, &value); + if (returnError != CCS811_Stat_SUCCESS) + { + return 0xFF; + } + else + { + return value; //Send all errors in the event of communication error + } +} + +//Returns the baseline value +//Used for telling sensor what 'clean' air is +//You must put the sensor in clean air and record this value +uint16_t CCS811::getBaseline(void) +{ + uint8_t data[2]; + CCS811Core::CCS811_Status_e returnError = multiReadRegister(CSS811_BASELINE, data, 2); + + unsigned int baseline = ((uint16_t)data[0] << 8) | data[1]; + if (returnError != CCS811_Stat_SUCCESS) + { + return 0; + } + else + { + return (baseline); + } +} + +CCS811Core::CCS811_Status_e CCS811::setBaseline(uint16_t input) +{ + uint8_t data[2]; + data[0] = (input >> 8) & 0x00FF; + data[1] = input & 0x00FF; + + CCS811Core::CCS811_Status_e returnError = multiWriteRegister(CSS811_BASELINE, data, 2); + + return returnError; +} + +//Enable the nINT signal +CCS811Core::CCS811_Status_e CCS811::enableInterrupts(void) +{ + uint8_t value; + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_MEAS_MODE, &value); //Read what's currently there + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + value |= (1 << 3); //Set INTERRUPT bit + writeRegister(CSS811_MEAS_MODE, value); + return returnError; +} + +//Disable the nINT signal +CCS811Core::CCS811_Status_e CCS811::disableInterrupts(void) +{ + uint8_t value; + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_MEAS_MODE, &value); //Read what's currently there + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + value &= ~(1 << 3); //Clear INTERRUPT bit + returnError = writeRegister(CSS811_MEAS_MODE, value); + return returnError; +} + +//Mode 0 = Idle +//Mode 1 = read every 1s +//Mode 2 = every 10s +//Mode 3 = every 60s +//Mode 4 = RAW mode +CCS811Core::CCS811_Status_e CCS811::setDriveMode(uint8_t mode) +{ + if (mode > 4) + mode = 4; //sanitize input + + uint8_t value; + CCS811Core::CCS811_Status_e returnError = readRegister(CSS811_MEAS_MODE, &value); //Read what's currently there + if (returnError != CCS811_Stat_SUCCESS) + return returnError; + value &= ~(0b00000111 << 4); //Clear DRIVE_MODE bits + value |= (mode << 4); //Mask in mode + returnError = writeRegister(CSS811_MEAS_MODE, value); + return returnError; +} + +//Given a temp and humidity, write this data to the CSS811 for better compensation +//This function expects the humidity and temp to come in as floats +CCS811Core::CCS811_Status_e CCS811::setEnvironmentalData(float relativeHumidity, float temperature) +{ + //Check for invalid temperatures + if ((temperature < -25) || (temperature > 50)) + return CCS811_Stat_GENERIC_ERROR; + + //Check for invalid humidity + if ((relativeHumidity < 0) || (relativeHumidity > 100)) + return CCS811_Stat_GENERIC_ERROR; + + uint32_t rH = relativeHumidity * 1000; //42.348 becomes 42348 + uint32_t temp = temperature * 1000; //23.2 becomes 23200 + + byte envData[4]; + + //Split value into 7-bit integer and 9-bit fractional + + //Incorrect way from datasheet. + //envData[0] = ((rH % 1000) / 100) > 7 ? (rH / 1000 + 1) << 1 : (rH / 1000) << 1; + //envData[1] = 0; //CCS811 only supports increments of 0.5 so bits 7-0 will always be zero + //if (((rH % 1000) / 100) > 2 && (((rH % 1000) / 100) < 8)) + //{ + // envData[0] |= 1; //Set 9th bit of fractional to indicate 0.5% + //} + + //Correct rounding. See issue 8: https://github.com/sparkfun/Qwiic_BME280_CCS811_Combo/issues/8 + envData[0] = (rH + 250) / 500; + envData[1] = 0; //CCS811 only supports increments of 0.5 so bits 7-0 will always be zero + + temp += 25000; //Add the 25C offset + //Split value into 7-bit integer and 9-bit fractional + //envData[2] = ((temp % 1000) / 100) > 7 ? (temp / 1000 + 1) << 1 : (temp / 1000) << 1; + //envData[3] = 0; + //if (((temp % 1000) / 100) > 2 && (((temp % 1000) / 100) < 8)) + //{ + // envData[2] |= 1; //Set 9th bit of fractional to indicate 0.5C + //} + + //Correct rounding + envData[2] = (temp + 250) / 500; + envData[3] = 0; + + CCS811Core::CCS811_Status_e returnError = multiWriteRegister(CSS811_ENV_DATA, envData, 4); + return returnError; +} + +uint16_t CCS811::getTVOC(void) +{ + return tVOC; +} + +uint16_t CCS811::getCO2(void) +{ + return CO2; +} + +//****************************************************************************// +// +// The CCS811 no longer supports temperature compensation from an NTC thermistor. +// NTC thermistor compensation will only work on boards purchased in 2017. +// List of unsupported functions: +// setRefResistance(); +// readNTC(); +// getResistance(); +// getTemperature(); +// +//****************************************************************************// + +void CCS811::setRefResistance(float input) +{ + refResistance = input; +} + +CCS811Core::CCS811_Status_e CCS811::readNTC(void) +{ + uint8_t data[4]; + CCS811Core::CCS811_Status_e returnError = multiReadRegister(CSS811_NTC, data, 4); + + vrefCounts = ((uint16_t)data[0] << 8) | data[1]; + //Serial.print("vrefCounts: "); + //Serial.println(vrefCounts); + ntcCounts = ((uint16_t)data[2] << 8) | data[3]; + //Serial.print("ntcCounts: "); + //Serial.println(ntcCounts); + //Serial.print("sum: "); + //Serial.println(ntcCounts + vrefCounts); + resistance = ((float)ntcCounts * refResistance / (float)vrefCounts); + + //Code from Milan Malesevic and Zoran Stupic, 2011, + //Modified by Max Mayfield, + temperature = log((long)resistance); + temperature = 1 / (0.001129148 + (0.000234125 * temperature) + (0.0000000876741 * temperature * temperature * temperature)); + temperature = temperature - 273.15; // Convert Kelvin to Celsius + + return returnError; +} + +float CCS811::getResistance(void) +{ + return resistance; +} + +float CCS811::getTemperature(void) +{ + return temperature; +} + +const char *CCS811::statusString(CCS811_Status_e stat) +{ + CCS811_Status_e val; + if (stat == CCS811_Stat_NUM) + { + val = stat; + } + else + { + val = stat; + } + + switch (val) + { + case CCS811_Stat_SUCCESS: + return "All is well."; + break; + case CCS811_Stat_ID_ERROR: + return "ID Error"; + break; + case CCS811_Stat_I2C_ERROR: + return "I2C Error"; + break; + case CCS811_Stat_INTERNAL_ERROR: + return "Internal Error"; + break; + case CCS811_Stat_GENERIC_ERROR: + return "Generic Error"; + break; + default: + return "Unknown Status"; + break; + } + return "None"; +} diff --git a/SampleSrc/TestBuild/SparkFunCCS811.h b/SampleSrc/TestBuild/SparkFunCCS811.h new file mode 100644 index 0000000..4d1478f --- /dev/null +++ b/SampleSrc/TestBuild/SparkFunCCS811.h @@ -0,0 +1,145 @@ +/****************************************************************************** +SparkFunCCS811.h +CCS811 Arduino library + +Marshall Taylor @ SparkFun Electronics +Nathan Seidle @ SparkFun Electronics + +April 4, 2017 + +https://github.com/sparkfun/CCS811_Air_Quality_Breakout +https://github.com/sparkfun/SparkFun_CCS811_Arduino_Library + +Resources: +Uses Wire.h for i2c operation + +Development environment specifics: +Arduino IDE 1.8.1 + +This code is released under the [MIT License](http://opensource.org/licenses/MIT). + +Please review the LICENSE.md file included with this example. If you have any questions +or concerns with licensing, please contact techsupport@sparkfun.com. + +Distributed as-is; no warranty is given. +******************************************************************************/ + +#ifndef __CCS811_H__ +#define __CCS811_H__ + +#include "stdint.h" +#include + +//Register addresses +#define CSS811_STATUS 0x00 +#define CSS811_MEAS_MODE 0x01 +#define CSS811_ALG_RESULT_DATA 0x02 +#define CSS811_RAW_DATA 0x03 +#define CSS811_ENV_DATA 0x05 +#define CSS811_NTC 0x06 //NTC compensation no longer supported +#define CSS811_THRESHOLDS 0x10 +#define CSS811_BASELINE 0x11 +#define CSS811_HW_ID 0x20 +#define CSS811_HW_VERSION 0x21 +#define CSS811_FW_BOOT_VERSION 0x23 +#define CSS811_FW_APP_VERSION 0x24 +#define CSS811_ERROR_ID 0xE0 +#define CSS811_APP_START 0xF4 +#define CSS811_SW_RESET 0xFF + +//This is the core operational class of the driver. +// CCS811Core contains only read and write operations towards the sensor. +// To use the higher level functions, use the class CCS811 which inherits +// this class. + +class CCS811Core +{ +public: + // Return values + typedef enum + { + CCS811_Stat_SUCCESS, + CCS811_Stat_ID_ERROR, + CCS811_Stat_I2C_ERROR, + CCS811_Stat_INTERNAL_ERROR, + CCS811_Stat_NUM, + CCS811_Stat_GENERIC_ERROR + //... + } CCS811_Status_e; + + CCS811Core(uint8_t); + ~CCS811Core() = default; + + void setI2CAddress(uint8_t address){ + I2CAddress = address; + } + CCS811_Status_e beginCore(TwoWire &wirePort); + + //***Reading functions***// + + //readRegister reads one 8-bit register + CCS811_Status_e readRegister(uint8_t offset, uint8_t *outputPointer); + //multiReadRegister takes a uint8 array address as input and performs + // a number of consecutive reads + CCS811_Status_e multiReadRegister(uint8_t offset, uint8_t *outputPointer, uint8_t length); + + //***Writing functions***// + + //Writes an 8-bit byte; + CCS811_Status_e writeRegister(uint8_t offset, uint8_t dataToWrite); + //multiWriteRegister takes a uint8 array address as input and performs + // a number of consecutive writes + CCS811_Status_e multiWriteRegister(uint8_t offset, uint8_t *inputPointer, uint8_t length); + +protected: + //Variables + TwoWire *_i2cPort; //The generic connection to user's chosen I2C hardware + uint8_t I2CAddress; +}; + +//This is the highest level class of the driver. +// +// class CCS811 inherits the CCS811Core and makes use of the beginCore() +//method through its own begin() method. It also contains user settings/values. + +class CCS811 : public CCS811Core +{ +public: + CCS811(uint8_t); + CCS811(); + + //Call to check for errors, start app, and set default mode 1 + bool begin(TwoWire &wirePort = Wire); //Use the Wire hardware by default + CCS811_Status_e beginWithStatus(TwoWire &wirePort = Wire); //Use the Wire hardware by default + const char *statusString(CCS811_Status_e stat = CCS811_Stat_NUM); // Returns a human-readable status message. Defaults to status member, but prints string for supplied status if supplied + + CCS811_Status_e readAlgorithmResults(void); + bool checkForStatusError(void); + bool dataAvailable(void); + bool appValid(void); + uint8_t getErrorRegister(void); + uint16_t getBaseline(void); + CCS811_Status_e setBaseline(uint16_t); + CCS811_Status_e enableInterrupts(void); + CCS811_Status_e disableInterrupts(void); + CCS811_Status_e setDriveMode(uint8_t mode); + CCS811_Status_e setEnvironmentalData(float relativeHumidity, float temperature); + void setRefResistance(float); //Unsupported feature. Refer to CPP file for more information. + CCS811_Status_e readNTC(void); //Unsupported feature. Refer to CPP file for more information. + uint16_t getTVOC(void); + uint16_t getCO2(void); + float getResistance(void); //Unsupported feature. Refer to CPP file for more information. + float getTemperature(void); //Unsupported feature. Refer to CPP file for more information. + +private: + //These are the air quality values obtained from the sensor + float refResistance; //Unsupported feature. Refer to CPP file for more information. + float resistance; //Unsupported feature. Refer to CPP file for more information. + uint16_t tVOC; + uint16_t CO2; + uint16_t vrefCounts = 0; + uint16_t ntcCounts = 0; + float temperature; +}; + +#endif // End of definition check diff --git a/SampleSrc/gasunit.ino b/SampleSrc/gasunit.ino new file mode 100644 index 0000000..2436804 --- /dev/null +++ b/SampleSrc/gasunit.ino @@ -0,0 +1,95 @@ +/* +******************************************************************************* +* Copyright (c) 2023 by M5Stack +* Equipped with M5Core sample source code +* 配套 M5Core 示例源代码 +* Visit for more information: https://docs.m5stack.com/en/unit/tvoc +* 获取更多资料请访问: https://docs.m5stack.com/zh_CN/unit/tvoc +* +* Describe: TVOC/eCO2. +* Date: 2021/8/26 +******************************************************************************* +Description: The screen will display TVOC and CO2. 屏幕将显示TVOC和CO2。 +Note: SGP30 needs 15 seconds to initialize calibration after power on. +*/ + +#include + +#include "Adafruit_SGP30.h" + +Adafruit_SGP30 sgp; +TFT_eSprite spu = TFT_eSprite(&M5.Lcd); // Sprite object + +long last_millis = 0; // for 15sec wait timer + +void setup() { + M5.begin(115200); + M5.Lcd.setRotation(3); + + spu.setColorDepth(8); + spu.createSprite(240, 135); + + + M5.Lcd.setTextSize(2); + M5.Lcd.fillScreen(TFT_YELLOW); + M5.Lcd.setTextSize(2); + M5.Lcd.setTextColor(TFT_BLACK); + M5.Lcd.setCursor(5, 5); + + while (!sgp.begin()) { // Init the sensor. + M5.Lcd.println("Sensor not found"); + delay(5000); + } + // M5.Lcd.println("Initialization..."); + +} + +void loop() { + static int i = 15; + while (i > 0) { + if (millis() - last_millis > 1000) { + last_millis = millis(); + i--; + spu.fillSprite(TFT_YELLOW); + spu.setTextColor( BLACK, YELLOW ); + spu.setCursor(30, 4, 4); spu.setTextSize(1); + spu.println("Initializing..."); + + spu.setCursor(60, 34, 4); spu.setTextSize(2); + spu.printf(" %d ", i ); + spu.pushSprite(0, 0); + delay(100); + } + } + + if (!sgp.IAQmeasure()) { // Commands the sensor to take a single eCO2/VOC + // measurement. 命令传感器进行一次eCO2/VOC测量 + Serial.println("Measurement failed"); + return; + } + spu.fillSprite( CYAN ); + spu.setCursor(93, 5, 4); spu.setTextSize(2); + spu.setTextColor( WHITE, BLUE ); + spu.printf(" %d \n", sgp.TVOC); + + spu.setCursor(93, 65, 4); spu.setTextSize(2); + spu.setTextColor( WHITE, BLUE ); + spu.printf(" %d \n", sgp.eCO2); + + spu.setTextColor( BLUE, CYAN ); + spu.setCursor(10, 20, 4); spu.setTextSize(1); + spu.println("TVOC : "); + spu.setCursor(10, 80, 4); spu.setTextSize(1); + spu.println("eCO2 : "); + + spu.pushSprite(0, 0); // 画面に反映させる + + Serial.printf("TVOC: %d eCO2: %d\n", sgp.TVOC, sgp.eCO2); + + M5.update(); + if (M5.Axp.GetBtnPress() == 2) { + M5.Axp.Write1Byte(0x32, M5.Axp.Read8bit(0x32) | 0x80); // Power Off + } + delay(500); +} + diff --git a/SampleSrc/httpclient01.ino b/SampleSrc/httpclient01.ino index b0e050b..4da4385 100644 --- a/SampleSrc/httpclient01.ino +++ b/SampleSrc/httpclient01.ino @@ -3,7 +3,7 @@ #include // ステータスコードの定義もここにある const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; void setup() { diff --git a/SampleSrc/httpserver01.ino b/SampleSrc/httpserver01.ino index 354375f..ae1a0ed 100644 --- a/SampleSrc/httpserver01.ino +++ b/SampleSrc/httpserver01.ino @@ -1,7 +1,7 @@ #include const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; WiFiServer server(80); diff --git a/SampleSrc/line01.ino b/SampleSrc/line01.ino index edfe943..ddf82e7 100644 --- a/SampleSrc/line01.ino +++ b/SampleSrc/line01.ino @@ -8,7 +8,7 @@ void setup() { Serial.begin(115200); WiFi.mode(WIFI_STA); - WiFiMulti.addAP("miura2g", "jikken2024"); + WiFiMulti.addAP("miura2g", "jikkenICS"); // wait for WiFi connection Serial.print("Waiting for WiFi to connect..."); diff --git a/SampleSrc/mqtt01pub.ino b/SampleSrc/mqtt01pub.ino index 16f94f4..787d771 100644 --- a/SampleSrc/mqtt01pub.ino +++ b/SampleSrc/mqtt01pub.ino @@ -5,7 +5,7 @@ #include const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; const char* server = "192.168.11.11"; // "mqtt.istlab.info"; const int port = 1883; // 注:学内ネットワークはポート制限あり。 diff --git a/SampleSrc/mqtt01sub.ino b/SampleSrc/mqtt01sub.ino index 9541bc8..5961bdf 100644 --- a/SampleSrc/mqtt01sub.ino +++ b/SampleSrc/mqtt01sub.ino @@ -8,7 +8,7 @@ #include const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; const char* server = "192.168.11.11"; // "mqtt.istlab.info"; const int port = 1883; // 注:学内ネットワークはポート制限あり。 diff --git a/SampleSrc/ntp01.ino b/SampleSrc/ntp01.ino index 05b59d7..86158eb 100644 --- a/SampleSrc/ntp01.ino +++ b/SampleSrc/ntp01.ino @@ -1,7 +1,7 @@ #include const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; void setup() { Serial.begin(115200); diff --git a/SampleSrc/ota01.ino b/SampleSrc/ota01.ino index 605c071..5c34820 100644 --- a/SampleSrc/ota01.ino +++ b/SampleSrc/ota01.ino @@ -3,7 +3,7 @@ #include const char *ssid = "miura2g"; -const char *password = "jikken2024"; +const char *password = "jikkenICS"; void setup() { diff --git a/SampleSrc/rtc01.ino b/SampleSrc/rtc01.ino index 64d4f2b..fe11620 100644 --- a/SampleSrc/rtc01.ino +++ b/SampleSrc/rtc01.ino @@ -36,7 +36,7 @@ if (USE_NTP) { const char* ssid = "miura2g"; - const char* password = "jikken2024"; + const char* password = "jikkenICS"; const char* ntpserver = "192.168.11.11"; // or ntp.nict.jp"; // or 10.64.7.184 for CIT-ap1x WiFi.begin(ssid, password); while (WiFi.status() != WL_CONNECTED) { // 接続中... diff --git a/SampleSrc/telnet01.ino b/SampleSrc/telnet01.ino index be33c26..2ce2995 100644 --- a/SampleSrc/telnet01.ino +++ b/SampleSrc/telnet01.ino @@ -27,7 +27,7 @@ //how many clients should be able to telnet to this ESP32 #define MAX_SRV_CLIENTS 3 const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; WiFiServer server(23); WiFiClient serverClients[MAX_SRV_CLIENTS]; diff --git a/SampleSrc/tofunit.ino b/SampleSrc/tofunit.ino new file mode 100644 index 0000000..acd9d4c --- /dev/null +++ b/SampleSrc/tofunit.ino @@ -0,0 +1,172 @@ +#include + +#define VL53L0X_REG_IDENTIFICATION_MODEL_ID 0xc0 +#define VL53L0X_REG_IDENTIFICATION_REVISION_ID 0xc2 +#define VL53L0X_REG_PRE_RANGE_CONFIG_VCSEL_PERIOD 0x50 +#define VL53L0X_REG_FINAL_RANGE_CONFIG_VCSEL_PERIOD 0x70 +#define VL53L0X_REG_SYSRANGE_START 0x00 +#define VL53L0X_REG_RESULT_INTERRUPT_STATUS 0x13 +#define VL53L0X_REG_RESULT_RANGE_STATUS 0x14 +#define address 0x29 // I2C address + +byte gbuf[16]; + + +TFT_eSprite spu = TFT_eSprite(&M5.Lcd); // Sprite object + + + +uint16_t bswap(byte b[]) { + // Big Endian unsigned short to little endian unsigned short + uint16_t val = ((b[0] << 8) & b[1]); + return val; +} + +uint16_t makeuint16(int lsb, int msb) { + return ((msb & 0xFF) << 8) | (lsb & 0xFF); +} + +void write_byte_data(byte data) { + Wire.beginTransmission(address); + Wire.write(data); + Wire.endTransmission(); +} + +void write_byte_data_at(byte reg, byte data) { + // write data word at address and register + Wire.beginTransmission(address); + Wire.write(reg); + Wire.write(data); + Wire.endTransmission(); +} + +void write_word_data_at(byte reg, uint16_t data) { + // write data word at address and register + byte b0 = (data & 0xFF); + byte b1 = ((data >> 8) && 0xFF); + + Wire.beginTransmission(address); + Wire.write(reg); + Wire.write(b0); + Wire.write(b1); + Wire.endTransmission(); +} + +byte read_byte_data() { + Wire.requestFrom(address, 1); + while (Wire.available() < 1) delay(1); + byte b = Wire.read(); + return b; +} + +byte read_byte_data_at(byte reg) { + // write_byte_data((byte)0x00); + write_byte_data(reg); + Wire.requestFrom(address, 1); + while (Wire.available() < 1) delay(1); + byte b = Wire.read(); + return b; +} + +uint16_t read_word_data_at(byte reg) { + write_byte_data(reg); + Wire.requestFrom(address, 2); + while (Wire.available() < 2) delay(1); + gbuf[0] = Wire.read(); + gbuf[1] = Wire.read(); + return bswap(gbuf); +} + +void read_block_data_at(byte reg, int sz) { + int i = 0; + write_byte_data(reg); + Wire.requestFrom(address, sz); + for (i = 0; i < sz; i++) { + while (Wire.available() < 1) delay(1); + gbuf[i] = Wire.read(); + } +} + +uint16_t VL53L0X_decode_vcsel_period(short vcsel_period_reg) { + // Converts the encoded VCSEL period register value into the real + // period in PLL clocks + uint16_t vcsel_period_pclks = (vcsel_period_reg + 1) << 1; + return vcsel_period_pclks; +} + +void setup() { + + M5.begin(115200); + M5.Lcd.setRotation(3); + + spu.setColorDepth(8); + spu.createSprite(240, 135); + + // put your setup code here, to run once: + Wire.begin(); // join i2c bus (address optional for master) + Serial.println("VLX53LOX test started."); + + + // M5.Lcd.setTextSize(2); + // M5.Lcd.fillScreen(TFT_YELLOW); + // M5.Lcd.setTextSize(2); + // M5.Lcd.setTextColor(TFT_BLACK); + // M5.Lcd.setCursor(5, 5); + +} + + +void loop() { + write_byte_data_at(VL53L0X_REG_SYSRANGE_START, 0x01); + + byte val = 0; + int cnt = 0; + while (cnt < 100) { // 1 second waiting time max + delay(10); + val = read_byte_data_at(VL53L0X_REG_RESULT_RANGE_STATUS); + if (val & 0x01) break; + cnt++; + } + if (val & 0x01){ + // Serial.println("ready"); + } else { + Serial.println("not ready"); + } + read_block_data_at(0x14, 12); + uint16_t acnt = makeuint16(gbuf[7], gbuf[6]); + uint16_t scnt = makeuint16(gbuf[9], gbuf[8]); + uint16_t dist = makeuint16(gbuf[11], gbuf[10]); + byte DeviceRangeStatusInternal = ((gbuf[0] & 0x78) >> 3); + + spu.fillSprite( CYAN ); + + spu.setCursor(93, 65, 4); spu.setTextSize(2); + spu.setTextColor( WHITE, BLUE ); + if (DeviceRangeStatusInternal != 11) { + spu.setTextColor( WHITE, RED ); + } + spu.printf(" %d \n", DeviceRangeStatusInternal); + + spu.setCursor(93, 5, 4); spu.setTextSize(2); +// spu.setTextColor( WHITE, BLUE ); + spu.printf(" %d \n", dist); + + // + // spu.setTextColor( BLUE, CYAN ); + // spu.setCursor(10, 20, 4); spu.setTextSize(1); + // spu.println("TVOC : "); + // spu.setCursor(10, 80, 4); spu.setTextSize(1); + // spu.println("eCO2 : "); + + spu.pushSprite(0, 0); // 画面に反映させる + + // Serial.printf("TVOC: %d eCO2: %d\n", sgp.TVOC, sgp.eCO2); + + M5.update(); + if (M5.Axp.GetBtnPress() == 2) { + M5.Axp.Write1Byte(0x32, M5.Axp.Read8bit(0x32) | 0x80); // Power Off + } + delay(1000); +} + + diff --git a/SampleSrc/wifi01.ino b/SampleSrc/wifi01.ino index 7f6ef56..082539b 100644 --- a/SampleSrc/wifi01.ino +++ b/SampleSrc/wifi01.ino @@ -2,7 +2,7 @@ #include const char* ssid = "miura2g"; -const char* password = "jikken2024"; +const char* password = "jikkenICS"; void setup() { M5.begin(); diff --git a/SampleSrc/wifimac.ino b/SampleSrc/wifimac.ino index a6e3fd2..d72a769 100644 --- a/SampleSrc/wifimac.ino +++ b/SampleSrc/wifimac.ino @@ -2,7 +2,7 @@ #include const char *ssid = "miura2g"; -const char *password = "jikken2024"; +const char *password = "jikkenICS"; void setup() { diff --git a/wifi.ino b/wifi.ino index 0d50068..df8575e 100644 --- a/wifi.ino +++ b/wifi.ino @@ -2,7 +2,7 @@ #include const char *ssid = "miura2g"; // 802.11b/g (2.4GHz)only. 5GHz is not supported. -const char *password = "jikken2024"; +const char *password = "jikkenICS"; // const char *ntpserver = "192.168.11.11"; //実験室ローカルNTPサーバ const char *ntpserver = "ntp.nict.jp";