Subversion Repositories group.electronics

Rev

Rev 48 | Rev 51 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 48 Rev 49
Line 1... Line 1...
1
#include <avr/io.h>
1
#include <avr/io.h>
2
#include "wire.h"
2
#include "wire.h"
3
#include "lcd.h"
3
#include "lcd.h"
4
#include "macros.h"
4
#include "petelib.h"
5
#include <util/delay.h>
5
#include <util/delay.h>
6
 
6
 
7
struct {
7
struct {
8
	uint8_t display;
8
	uint8_t display;
9
	uint8_t function;
9
	uint8_t function;
Line 38... Line 38...
38
 
38
 
39
	lcd_home();
39
	lcd_home();
40
	_delay_ms(10);
40
	_delay_ms(10);
41
}
41
}
42
 
42
 
-
 
43
void lcd_pergraph(uint8_t val, uint8_t row, uint8_t col) {
-
 
44
	uint8_t i = 0;
-
 
45
	uint8_t c = val / 10;	
-
 
46
	lcd_setCursor(row, col);
-
 
47
	for (i = 0; i<=10; i++) {
-
 
48
		if (i <= c)
-
 
49
			lcd_char(0xff);
-
 
50
		else
-
 
51
			lcd_char(0x00);
-
 
52
	}
-
 
53
}
-
 
54
 
43
/** Helper functions **/
55
/** Helper functions **/
44
 
56
 
45
inline void lcd_clear() {
57
inline void lcd_clear() {
46
	lcd_command(LCD_CLEARDISPLAY);
58
	lcd_command(LCD_CLEARDISPLAY);
47
}
59
}