mirror of
https://gitlab.dit.htwk-leipzig.de/phillip.kuehne/dezibot.git
synced 2025-06-01 17:31:46 +02:00
added documentation to display headerfile
This commit is contained in:
parent
d67a33c53f
commit
4ffed430e2
@ -138,8 +138,20 @@ void Display::print(char *value){
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
};
|
};
|
||||||
void Display::println(char *value){
|
|
||||||
|
|
||||||
|
void Display::flipOrientation(void){
|
||||||
|
if(this->orientationFlipped){
|
||||||
|
sendDisplayCMD(setComDirectionNormal);
|
||||||
|
sendDisplayCMD(setSegmentMap);
|
||||||
|
} else{
|
||||||
|
sendDisplayCMD(setComDirectionFlipped);
|
||||||
|
sendDisplayCMD(setSegmentReMap);
|
||||||
|
}
|
||||||
|
this->orientationFlipped = !this->orientationFlipped;
|
||||||
|
}
|
||||||
|
void Display::println(char *value){
|
||||||
|
this ->print(value);
|
||||||
|
this->print("\n");
|
||||||
};
|
};
|
||||||
void Display::print(int value){
|
void Display::print(int value){
|
||||||
|
|
||||||
|
@ -21,14 +21,55 @@ class Display{
|
|||||||
uint8_t charsOnCurrLine = 0;
|
uint8_t charsOnCurrLine = 0;
|
||||||
//on which line are we currently printing
|
//on which line are we currently printing
|
||||||
uint8_t currLine = 0;
|
uint8_t currLine = 0;
|
||||||
|
//flag that marks if the y-orientation is currently flipped
|
||||||
|
bool orientationFlipped = false;
|
||||||
|
/**
|
||||||
|
* @brief sends the passed cmd to the display, cmd_byte is added as prefix by the function
|
||||||
|
*
|
||||||
|
* @param cmd the byte instruction that shold by sent
|
||||||
|
*/
|
||||||
void sendDisplayCMD(uint8_t cmd);
|
void sendDisplayCMD(uint8_t cmd);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief should be called whenever characters where printed to the display.
|
||||||
|
* Updates the data of the class to handle linebreaks correctly
|
||||||
|
* @param charAmount How many characters where added to the screen
|
||||||
|
*/
|
||||||
void updateLine(uint charAmount);
|
void updateLine(uint charAmount);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief initializes the display datastructures and sents the required cmds to start the display. Should only be called once.
|
||||||
|
* @warning doesn't initalize the I²C bus itself, therefore wire.begin(1,2) must be called elsewhere, before this method.
|
||||||
|
*/
|
||||||
void begin(void);
|
void begin(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief delets all content from the display, resets the linecounter, new print will start at the top left.
|
||||||
|
* Orientationflip is not resetted
|
||||||
|
*/
|
||||||
void clear(void);
|
void clear(void);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief prints the passed string right behind the current displaycontent
|
||||||
|
* the sequence "\n" can be used to make a linebreak on the display
|
||||||
|
*
|
||||||
|
* @param value the string "xyz" that should be printed to the display
|
||||||
|
*/
|
||||||
void print(char *value);
|
void print(char *value);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief same as the print method, but after the string a line break is inserted
|
||||||
|
*
|
||||||
|
* @param value the string that should be printed
|
||||||
|
*/
|
||||||
void println(char *value);
|
void println(char *value);
|
||||||
void print(int value);
|
void print(int value);
|
||||||
|
/**
|
||||||
|
* @brief flips the horizontal orientation of all content on the display
|
||||||
|
*/
|
||||||
|
void flipOrientation(void);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,7 +26,6 @@ class InfraredLED{
|
|||||||
/**
|
/**
|
||||||
* @brief enables selected LED
|
* @brief enables selected LED
|
||||||
*
|
*
|
||||||
* @param led
|
|
||||||
*/
|
*/
|
||||||
void turnOn(void);
|
void turnOn(void);
|
||||||
/**
|
/**
|
||||||
|
Loading…
x
Reference in New Issue
Block a user