mirror of
https://github.com/Derisis13/AT-VFD.git
synced 2025-12-06 19:32:49 +01:00
* QA: formatting
* Feature: `set_duty()` for setting VFD duty cycle
This commit is contained in:
17
PT6302.c
17
PT6302.c
@@ -42,13 +42,22 @@ void transmit_bytes (const uint8_t *payload, const uint8_t size)
|
||||
PORTB |= CSBpin;
|
||||
}
|
||||
|
||||
|
||||
void set_ports(uint8_t gp1, uint8_t gp2)
|
||||
void set_ports (uint8_t gp1, uint8_t gp2)
|
||||
{
|
||||
uint8_t command = 0x40;
|
||||
if(gp1 != 0 )
|
||||
if (gp1 != 0)
|
||||
command |= 0x01;
|
||||
if (gp2 != 0)
|
||||
command |= 0x02;
|
||||
transmit_bytes (&command, 1);
|
||||
}
|
||||
}
|
||||
|
||||
void set_duty (uint8_t brightness)
|
||||
{
|
||||
if (brightness > 7)
|
||||
{
|
||||
brightness = 7;
|
||||
}
|
||||
uint8_t command = 0x50 | brightness;
|
||||
transmit_bytes (&command, 1);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user