added comments
This commit is contained in:
@@ -6,31 +6,38 @@
|
||||
#include "setup.h"
|
||||
#include "dseg7_7seggchan_mini_font_48p_regular.h"
|
||||
#include "dseg7_classic_mini_font_11p_regular.h"
|
||||
#include "DejaVu_Sans_Mono_font_12p_regular.h"
|
||||
#include "DialogInput_font_12p_regular.h"
|
||||
#include <hardware/adc.h>
|
||||
#include "images.h"
|
||||
|
||||
//screen definitions
|
||||
#define SCREEN_WIDTH 128
|
||||
#define SCREEN_HEIGHT 64
|
||||
#define OLED_RESET -1
|
||||
#define SCREEN_ADDRESS 0x3C
|
||||
|
||||
//variable definitions
|
||||
float voltage = 0;
|
||||
float current = 0;
|
||||
float wattage = 0;
|
||||
int usb_score = -1;
|
||||
int usb_score = 8;
|
||||
int uptime_min = 0;
|
||||
int uptime_sec = 0;
|
||||
|
||||
|
||||
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);
|
||||
|
||||
void setup() {
|
||||
adc_init();
|
||||
adc_set_temp_sensor_enabled(true);
|
||||
//adc_init();
|
||||
//adc_set_temp_sensor_enabled(true);
|
||||
Serial.begin(115200);
|
||||
//sets i2c pins
|
||||
Wire.setSDA(I2C_SDA);
|
||||
Wire.setSCL(I2C_SCL);
|
||||
//i2c start
|
||||
Wire.begin();
|
||||
|
||||
//display init
|
||||
if(!display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS)){
|
||||
Serial.println("Display Error: Check Connections");
|
||||
Serial.print("SDA=");
|
||||
@@ -49,6 +56,7 @@ void loop() {
|
||||
|
||||
}
|
||||
|
||||
//display draw function
|
||||
void drawDisplay() {
|
||||
if(!use_default_fonts){
|
||||
display.clearDisplay();
|
||||
|
||||
Reference in New Issue
Block a user