1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//! An implementation of the [`embedded-graphics::DrawTarget`] trait using the [`flipdot`] crate
//! to provide an easy way to send text and graphics to Luminator flip-dot and LED signs over RS-485.
//!
//! Tested with a MAX3000 90 × 7 side sign. Should work with any flip-dot or LED sign that uses the 7-pin circular
//! connector, but no guarantees.
//!
//! Intended only for hobbyist and educational purposes. Not affiliated with Luminator in any way.
//!
//! # Examples
//!
//! ```no_run
//! use flipdot_graphics::{Address, FlipdotDisplay, SignBusType, SignType};
//!
//! use embedded_graphics::{
//! mono_font::{ascii::FONT_5X7, MonoTextStyle},
//! pixelcolor::BinaryColor,
//! prelude::*,
//! primitives::{Circle, PrimitiveStyle, Triangle},
//! text::{Baseline, Text},
//! };
//!
//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
//! #
//! // Create a display for a sign connected over serial.
//! let mut display = FlipdotDisplay::try_new(
//! SignBusType::Serial("/dev/ttyUSB0"),
//! Address(3),
//! SignType::Max3000Side90x7
//! )?;
//!
//! // Draw a circle and a triangle.
//! Circle::new(Point::new(2, 0), 6)
//! .into_styled(PrimitiveStyle::with_stroke(BinaryColor::On, 1))
//! .draw(&mut display)?;
//!
//! Triangle::new(Point::new(11, 1), Point::new(15, 5), Point::new(19, 1))
//! .into_styled(PrimitiveStyle::with_fill(BinaryColor::On))
//! .draw(&mut display)?;
//!
//! // Send the page to the sign.
//! display.flush()?;
//!
//! // Keep editing the same page, adding some text.
//! let style = MonoTextStyle::new(&FONT_5X7, BinaryColor::On);
//! Text::with_baseline("Hello, world!", Point::new(24, 0), style, Baseline::Top)
//! .draw(&mut display)?;
//!
//! // Send the updated page to the sign.
//! display.flush()?;
//!
//! // Turn all pixels on.
//! display.clear(BinaryColor::On)?;
//! display.flush()?;
//!
//! // Turn all pixels off.
//! display.clear(BinaryColor::Off)?;
//! display.flush()?;
//! #
//! # Ok(()) }
//! ```
//!
//! [`embedded-graphics::DrawTarget`]: https://docs.rs/embedded-graphics-core/latest/embedded_graphics_core/draw_target/trait.DrawTarget.html
//! [`flipdot`]: https://docs.rs/flipdot
pub use ;
pub use ;