This file contains hidden or 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 "ESPert.h" | |
| #include <Wire.h> | |
| #include <Adafruit_Sensor.h> | |
| #include <Adafruit_ADXL345_U.h> | |
| ESPert espert; | |
| Adafruit_ADXL345_Unified accel = Adafruit_ADXL345_Unified(12345); | |
| //byte bitmap [] = {0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x93,0x00,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0xff,0x93,0x0 |
This file contains hidden or 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
| function calculate_initial_capacity_percentage(voltage) | |
| { | |
| //voltage is adc 10bit | |
| voltage = voltage * 5 / 1024; // แปลงค่า Raw ที่ส่งมาเป็น แรงดัน | |
| capacity = 0; | |
| if (voltage > 4.2){ | |
| capacity = 100; | |
| }else if(voltage < 3.2 ){ | |
| capacity = 0; | |
| }else if (voltage > 4 ){ |
This file contains hidden or 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
| /** | |
| * Displays text sent over the serial port (e.g. from the Serial Monitor) on | |
| * an attached LCD. | |
| */ | |
| #include <ESP8266WiFi.h> | |
| #include <Wire.h> | |
| #include <LiquidCrystal_I2C.h> | |
| //https://github.com/fdebrabander/Arduino-LiquidCrystal-I2C-library | |
| #define _MAX_TEXT_BUFFER_ 1024 |
NewerOlder