mirror of
https://github.com/Derisis13/AT-VFD.git
synced 2025-12-06 19:32:49 +01:00
* feature: Resetting the VFD works
* optimisation: made the code leaner
This commit is contained in:
22
PT6302.c
22
PT6302.c
@@ -44,25 +44,3 @@ void transmit_bytes (const uint8_t *payload, const uint8_t size)
|
||||
_delay_us (DTCSH);
|
||||
PORTB |= CSBpin;
|
||||
}
|
||||
|
||||
|
||||
void set_display_brightness (uint8_t level)
|
||||
{
|
||||
switch (level)
|
||||
{
|
||||
case 0:transmit_bytes (0x0A, 1);
|
||||
break;
|
||||
case 1:transmit_bytes (0x2A, 1);
|
||||
break;
|
||||
case 2:transmit_bytes (0x4A, 1);
|
||||
break;
|
||||
case 3:transmit_bytes (0x6A, 1);
|
||||
break;
|
||||
case 4:transmit_bytes (0x8A, 1);
|
||||
break;
|
||||
case 5:transmit_bytes (0xAA, 1);
|
||||
break;
|
||||
case 6:transmit_bytes (0xCA, 1);
|
||||
default:transmit_bytes (0xEA, 1);
|
||||
}
|
||||
}
|
||||
|
||||
9
PT6302.h
9
PT6302.h
@@ -19,7 +19,7 @@
|
||||
|
||||
|
||||
/* -------------------------------------------------------------
|
||||
* Innitial setup for the VFD controller interface
|
||||
* Initial setup for the VFD controller interface
|
||||
* Sets up the connected pins and leaves them in inactive state.
|
||||
* ------------------------------------------------------------- */
|
||||
void PT6302_startup(void);
|
||||
@@ -32,11 +32,4 @@ void PT6302_startup(void);
|
||||
void transmit_bytes (const uint8_t* payload, uint8_t size);
|
||||
|
||||
|
||||
/* --------------------------------------------------------------
|
||||
* Set the brightness of the VFD
|
||||
* level can be between 0-7, 7 and larger will set max brightness
|
||||
* It sets the display's duty cycle to conroll the brightness
|
||||
* -------------------------------------------------------------- */
|
||||
void set_display_brightness (uint8_t level);
|
||||
|
||||
#endif //_PT6302_H_
|
||||
|
||||
Reference in New Issue
Block a user