mirror of
https://github.com/BotChain-Robots/firmware.git
synced 2026-07-08 17:47:21 +02:00
Display control code
This commit is contained in:
23
components/oled/include/Oled.h
Normal file
23
components/oled/include/Oled.h
Normal file
@@ -0,0 +1,23 @@
|
||||
|
||||
#include <cstdint>
|
||||
#include <string>
|
||||
|
||||
#ifndef OLED_H
|
||||
#define OLED_H
|
||||
|
||||
class Oled {
|
||||
public:
|
||||
Oled(uint8_t sda_pin, uint8_t scl_pin) {
|
||||
init(sda_pin, scl_pin);
|
||||
};
|
||||
void clear_display();
|
||||
void set_contrast(uint8_t contrast);
|
||||
void display_text(const std::string& text);
|
||||
|
||||
private:
|
||||
void init(uint8_t sda_pin, uint8_t scl_pin);
|
||||
void rotate8x8(uint8_t in[8], uint8_t out[8]);
|
||||
|
||||
};
|
||||
|
||||
#endif // OLED_H
|
||||
Reference in New Issue
Block a user