Compare commits

..

No commits in common. "8bb4a2ff554bf081c0318c6be17ffec4c2259e54" and "cf35e07c2fad900019d0720e0c6a0cf9e20e55dc" have entirely different histories.

8 changed files with 21 additions and 67 deletions

View File

@ -10,6 +10,5 @@
"initializer_list": "cpp", "initializer_list": "cpp",
"adafruit_ads1x15.h": "c" "adafruit_ads1x15.h": "c"
}, },
"cmake.configureOnOpen": true, "cmake.configureOnOpen": true
"cmake.sourceDirectory": "D:/Git/ESPMegaPRO-v3-SDK/Template Project/.pio/libdeps/wt32-eth01/Adafruit BusIO"
} }

View File

@ -6,7 +6,7 @@ uint8_t inputBufferB;
PCF8574 inputBankA(INPUT_BANK_A_ADDRESS); PCF8574 inputBankA(INPUT_BANK_A_ADDRESS);
PCF8574 inputBankB(INPUT_BANK_B_ADDRESS); PCF8574 inputBankB(INPUT_BANK_B_ADDRESS);
Adafruit_PWMServoDriver pwmBank = Adafruit_PWMServoDriver(PWM_BANK_ADDRESS); Adafruit_PWMServoDriver pwmBank = Adafruit_PWMServoDriver(PWM_BANK_ADDRESS);
FRAM ESPMega_FRAM; I2C_eeprom ESPMega_EEPROM(EEPROM_ADDRESS);
#ifdef ANALOG_CARD_ENABLE #ifdef ANALOG_CARD_ENABLE
Adafruit_ADS1115 analogInputBankA; Adafruit_ADS1115 analogInputBankA;
@ -23,7 +23,7 @@ void ESPMega_begin()
inputBankA.begin(); inputBankA.begin();
inputBankB.begin(); inputBankB.begin();
pwmBank.begin(); pwmBank.begin();
ESPMega_FRAM.begin(FRAM_ADDRESS); ESPMega_EEPROM.begin();
// ESPMegaPRO v3 use the PWMBank to drive Half Bridge // ESPMegaPRO v3 use the PWMBank to drive Half Bridge
// Push Pull Output is required. // Push Pull Output is required.
pwmBank.setOutputMode(true); pwmBank.setOutputMode(true);

View File

@ -5,7 +5,7 @@
#include <Wire.h> #include <Wire.h>
#include <Adafruit_PWMServoDriver.h> #include <Adafruit_PWMServoDriver.h>
#include <PCF8574.h> #include <PCF8574.h>
#include <FRAM.h> #include <I2C_eeprom.h>
#include <TimeLib.h> #include <TimeLib.h>
#include <DS1307RTC.h> #include <DS1307RTC.h>
#include <time.h> #include <time.h>
@ -24,12 +24,12 @@
#define DAC1_ADDRESS 0x61 #define DAC1_ADDRESS 0x61
#define DAC2_ADDRESS 0x62 #define DAC2_ADDRESS 0x62
#define DAC3_ADDRESS 0x63 #define DAC3_ADDRESS 0x63
#define FRAM_ADDRESS 0x56 #define EEPROM_ADDRESS 0x5A
//#define USE_INTERRUPT //#define USE_INTERRUPT
#define INPUT_BANK_A_INTERRUPT 36 #define INPUT_BANK_A_INTERRUPT 36
#define INPUT_BANK_B_INTERRUPT 39 #define INPUT_BANK_B_INTERRUPT 39
extern FRAM ESPMega_FRAM; extern I2C_eeprom ESPMega_EEPROM;
#define ESPMega_configNTP configTime #define ESPMega_configNTP configTime
struct rtctime_t { struct rtctime_t {
uint8_t hours; uint8_t hours;

View File

@ -20,7 +20,7 @@ lib_deps = adafruit/Adafruit PWM Servo Driver Library@^2.4.1
arduino-libraries/Arduino_BuiltIn@^1.0.0 arduino-libraries/Arduino_BuiltIn@^1.0.0
SPI@^2.0.0 SPI@^2.0.0
robtillaart/MCP4725@^0.3.7 robtillaart/MCP4725@^0.3.7
robtillaart/FRAM_I2C@^0.6.1 robtillaart/I2C_EEPROM@^1.7.3
paulstoffregen/Time@^1.6.1 paulstoffregen/Time@^1.6.1
paulstoffregen/DS1307RTC@0.0.0-alpha+sha.c2590c0033 paulstoffregen/DS1307RTC@0.0.0-alpha+sha.c2590c0033
monitor_speed = 115200 monitor_speed = 115200

View File

@ -1,22 +0,0 @@
#include <ESPMegaPRO.h>
#define ADC
void setup()
{
Serial.begin(115200);
ESPMega_begin();
}
void loop()
{
#ifdef DAC
for(int i=0;i<4096;i++) {
ESPMega_dacWrite(0,i);
double dac_val_sine = 2047.5*sin(i*2*PI/2047.5)+2047.5;
ESPMega_dacWrite(1,(int)dac_val_sine);
}
#endif
#ifdef ADC
Serial.printf("A0: %d",ESPMega_analogRead(0));
#endif
}

View File

@ -0,0 +1,14 @@
#include <ESPMegaPRO.h>
void setup()
{
Serial.begin(115200);
ESPMega_begin();
ESPMega_dacWrite(0,2000);
ESPMega_dacWrite(1,2000);
}
void loop()
{
delay(100);
}

View File

@ -1,37 +0,0 @@
#include <ESPMegaPRO.h>
void setup()
{
ESPMega_begin();
Serial.begin(115200);
uint8_t a = 35;
uint8_t b = 42;
uint8_t c = 66;
uint8_t d = 251;
// ESPMega_FRAM.write8(0,a);
// ESPMega_FRAM.write8(1,b);
// ESPMega_FRAM.write8(2,c);
// ESPMega_FRAM.write8(3,d);
uint8_t e = ESPMega_FRAM.read8(0);
uint8_t f = ESPMega_FRAM.read8(1);
uint8_t g = ESPMega_FRAM.read8(2);
uint8_t h = ESPMega_FRAM.read8(3);
Serial.println(e);
Serial.println(f);
Serial.println(g);
Serial.println(h);
char ll[2000] = "Everyone has a dream they strive to achieve, and so does the musically talented Kanon Shibuya. However, due to her stage fright, Kanon fails to make it into Yuigaoka Girls' High School's music program and instead ends up in the general curriculum. Even though Kanon makes the conscious decision to quit music altogether, her classmate Tang Keke rekindles Kanon's passion for music with her own: a passion for school idols.";
// ESPMega_FRAM.write(4,(uint8_t*)ll,2000);
char llr[2000];
ESPMega_FRAM.read(4,(uint8_t*)llr,2000);
Serial.println(llr);
}
void loop()
{
}