# pdc_6x1

`no_std` driver for 6-digit 7-segment display (PDC-6x1).

## Peculiarities

- **Hardware Agnostic**: Works with any MCU via `embedded-hal`.
- **no_std**: Suitable for bare-metal embedded applications.
- Tested on STM32, ESP32, RP2040.

## Usage

In `Cargo.toml`:
```toml
[dependencies]
pdc_6x1 = "0.1.0"
```

## Example for ESP32C3

```rust
#![no_std]
#![no_main]

use esp_hal::{main, delay, clock, gpio::{Level, Output, OutputConfig}};
use pdc_6x1::Pdc6x1;

#[panic_handler]
fn panic(_: &core::panic::PanicInfo) -> ! {
    loop {}
}

#[main]
fn main() -> ! {
    let config = esp_hal::Config::default().with_cpu_clock(clock::CpuClock::max());
    let peripherals = esp_hal::init(config);

    let delay = delay::Delay::new(); // Need features "unstable". 

    let data = Output::new(peripherals.GPIO6, Level::High, OutputConfig::default());
    let wr = Output::new(peripherals.GPIO7, Level::High, OutputConfig::default());
    let cs = Output::new(peripherals.GPIO4, Level::High, OutputConfig::default());

    let mut lcd = Pdc6x1::new(data, wr, cs, delay);

    lcd.battery(2);
    lcd.clear();
    lcd.print_str("Error");
    lcd.print_i32(-12345);
    lcd.print_f32(-0.123, 2);
    lcd.print_degrees(123);

    loop {
        for i in -99999..999999 {
            lcd.print_i32(i);
        }
    }
}
```

## Appearance

![Front](Front.jpg)
![Back](Back.jpg)

## License

MIT or Apache-2.0.