mirror of
https://github.com/lora-aprs/LoRa_APRS_iGate.git
synced 2026-04-06 06:55:06 +00:00
big update:
- display update - timer changed to ms - allow connections just when connected
This commit is contained in:
parent
c96a0310ae
commit
2c78a002ab
19 changed files with 332 additions and 351 deletions
|
|
@ -1,42 +1,35 @@
|
|||
#include "SSD1306.h"
|
||||
|
||||
SSD1306::SSD1306(TwoWire * wire, uint8_t address, OLEDDISPLAY_GEOMETRY g)
|
||||
: OLEDDisplay(g), _wire(wire), _address(address)
|
||||
{
|
||||
sendInitCommands();
|
||||
SSD1306::SSD1306(TwoWire *wire, uint8_t address, OLEDDISPLAY_GEOMETRY g) : OLEDDisplay(g), _wire(wire), _address(address) {
|
||||
sendInitCommands();
|
||||
}
|
||||
|
||||
SSD1306::~SSD1306()
|
||||
{
|
||||
SSD1306::~SSD1306() {
|
||||
}
|
||||
|
||||
void SSD1306::display(Bitmap * bitmap)
|
||||
{
|
||||
sendCommand(PAGEADDR);
|
||||
sendCommand(0x0);
|
||||
sendCommand(0xFF);
|
||||
void SSD1306::internDisplay(Bitmap *bitmap) {
|
||||
sendCommand(PAGEADDR);
|
||||
sendCommand(0x0);
|
||||
sendCommand(0xFF);
|
||||
|
||||
sendCommand(COLUMNADDR);
|
||||
sendCommand(0x0);
|
||||
sendCommand(getWidth() - 1);
|
||||
sendCommand(COLUMNADDR);
|
||||
sendCommand(0x0);
|
||||
sendCommand(getWidth() - 1);
|
||||
|
||||
for (int i = 0; i < getWidth() * getHeight() / 8; )
|
||||
{
|
||||
Wire.beginTransmission(_address);
|
||||
Wire.write(0x40);
|
||||
for (uint8_t x = 0; x < 16; x++)
|
||||
{
|
||||
Wire.write(bitmap->_buffer[i]);
|
||||
i++;
|
||||
}
|
||||
Wire.endTransmission();
|
||||
}
|
||||
for (int i = 0; i < getWidth() * getHeight() / 8;) {
|
||||
Wire.beginTransmission(_address);
|
||||
Wire.write(0x40);
|
||||
for (uint8_t x = 0; x < 16; x++) {
|
||||
Wire.write(bitmap->_buffer[i]);
|
||||
i++;
|
||||
}
|
||||
Wire.endTransmission();
|
||||
}
|
||||
}
|
||||
|
||||
void SSD1306::sendCommand(uint8_t command)
|
||||
{
|
||||
_wire->beginTransmission(_address);
|
||||
_wire->write(0x80);
|
||||
_wire->write(command);
|
||||
_wire->endTransmission();
|
||||
void SSD1306::sendCommand(uint8_t command) {
|
||||
_wire->beginTransmission(_address);
|
||||
_wire->write(0x80);
|
||||
_wire->write(command);
|
||||
_wire->endTransmission();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue