-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
64 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
How to use it | ||
============= | ||
|
||
## Class LcdHistogram | ||
|
||
--- | ||
```c++ | ||
LcdHistogram(LiquidCrystal* lcd, int posx, int posy, int length); | ||
``` | ||
Creates a new histogram. | ||
Parameters: | ||
* `lcd` - An instance of LiquidCrystal previously created | ||
* `posx` - Row on the screen of the first bar | ||
* `posy` - Line on the screen of the first bar | ||
* `length` - Length of the histogram in characters | ||
--- | ||
```c++ | ||
void push(float number); | ||
``` | ||
Adds a number in the histogram. | ||
Parameter: | ||
* `number` - A single data to add at the end | ||
|
||
--- | ||
```c++ | ||
void plot(); | ||
``` | ||
Print the graph. | ||
|
||
--- | ||
```c++ | ||
void setMode(GraphMode m); | ||
``` | ||
Change the way the graph is being printed. | ||
Parameter: | ||
* `m` - New mode | ||
## Enum GraphMode | ||
Defines the drawing behavior | ||
For example, for the numbers {80, 95, 100, 70, 90}, it will print : | ||
* ABSOLUTE : ▆██▆▇ | ||
* DYNAMIC : ▃▇█ ▅ | ||
--- | ||
```c++ | ||
ABSOLUTE | ||
``` | ||
Draw each bar considering 0 as minimum value. | ||
|
||
--- | ||
```c++ | ||
DYNAMIC | ||
``` | ||
Get the chart more readable by adjusting the length of the bars according to the minimum value. | ||
|