I wanted to finally power the display, but just ran out of level converters. Well - ordered a couple of 08745 Logic Level Converters and waiting for them (cause the EA-Board is using 3.3V and Arduino Leonardo supplies 5V).
Looking at the code reveals this line:
// configure temperature sensor
S5813A.begin(Pin_TEMPERATURE);
this will redirect to:
void S5813A_Class::begin(int input_pin) {
pinMode(input_pin, INPUT);
analogReference(ANALOG_REFERENCE);
this->temperature_pin = input_pin;
}
As the EA has a I2C temperature sensor we need to play with those lines (remove analogReference).
After that the main loop wants to read the temperature:
int temperature = S5813A.read();
this will trigger:
int S5813A_Class::read() {
return Tstart_C + ((this->readVoltage() - Vstart_uV) / Vslope_uV);
}
Again - as EA is using a I2C sensor we have to play withthe code. I think Arduino uses the Wire.h to communicate over I2C? But then we need the address of the temp sensor on the bus. EA writes "I2C address (0x92/0x93)" on the datasheet.
So we should be able to get the temp by modifying above code to:
Wire.beginTransmission(addr) <- (where addr is defined futher up int addr = 92;)
Wire.send(0);
Wire.endTransmission();
Wire.requestFrom(addr,1);
While(wire.available == 0) ;
int temp = Wire.receive();
return temp;
After reading the temp the code wants to run the setFactor funtion
EPD.setFactor(temperature)
This function is defined in EPD.h. But it looks like 25 is a fixed value here. Well maybe it works like that??
void setFactor(int temperature = 25) {
this->factored_stage_time = this->stage_time * this->temperature_to_factor_10x(temperature) / 10;
}
I still have some questions concerning the code. But unless I have my logic level converters I cannot work on the display. Maybe someone can get that thing to work in the meantime.
Oh – I almost forgot! As the EA doesn’t come with a Flash chip, we'll either have to use the onboard flash, get a SD Shield or leave out the whole flash-code. At least the code is prepared if doesn’t find any flash chip (or a unsupported one):
FLASH.begin(Pin_FLASH_CS, SPI);
if (FLASH.available()) {
Serial.println("FLASH chip detected OK");
} else {
Serial.println("unsupported FLASH chip");
}