Add the 74HC595 Snake game project
This commit is contained in:
28
08-74HC595-Snake/IC74HC595.h
Normal file
28
08-74HC595-Snake/IC74HC595.h
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifndef _IC74HC595_H_
|
||||
#define _IC74HC595_H_
|
||||
|
||||
// We save 4 pins by updating all 3 shift registers at once
|
||||
// with one clock and one update signal. Each shift register
|
||||
// only needs its own data line.
|
||||
#define PIN_74HC595_SCOREBOARD_CLOCK 11
|
||||
#define PIN_74HC595_MATRIX_CLOCK 12
|
||||
|
||||
#define PIN_74HC595_MATRIX_UPDATE 8
|
||||
#define PIN_74HC595_SCOREBOARD_UPDATE 17
|
||||
|
||||
#define PIN_74HC595_MATRIX_DATA 18
|
||||
#define PIN_74HC595_SCOREBOARD_DATA 14
|
||||
|
||||
typedef struct IC74HC595 {
|
||||
uint8_t updatepin;
|
||||
uint8_t datapin;
|
||||
uint8_t clockpin;
|
||||
} IC74HC595;
|
||||
|
||||
extern IC74HC595 matrixcols;
|
||||
extern IC74HC595 scoreboard;
|
||||
|
||||
int init74HC595(IC74HC595 *sr);
|
||||
int writeIC74HC595Char(IC74HC595 *sr, uint8_t value, uint8_t order);
|
||||
|
||||
#endif // _IC74HC595_H_
|
||||
Reference in New Issue
Block a user