@@ -18,49 +18,54 @@ fn main() {
18
18
disp. init ( ) . unwrap ( ) ;
19
19
disp. flush ( ) . unwrap ( ) ;
20
20
21
- disp. draw (
22
- Line :: new ( Point :: new ( 8 , 16 + 16 ) , Point :: new ( 8 + 16 , 16 + 16 ) )
23
- . stroke ( Some ( BinaryColor :: On ) )
24
- . into_iter ( ) ,
25
- ) ;
26
- disp. draw (
27
- Line :: new ( Point :: new ( 8 , 16 + 16 ) , Point :: new ( 8 + 8 , 16 ) )
28
- . stroke ( Some ( BinaryColor :: On ) )
29
- . into_iter ( ) ,
30
- ) ;
31
- disp. draw (
32
- Line :: new ( Point :: new ( 8 + 16 , 16 + 16 ) , Point :: new ( 8 + 8 , 16 ) )
33
- . stroke ( Some ( BinaryColor :: On ) )
34
- . into_iter ( ) ,
35
- ) ;
21
+ loop {
22
+ disp. draw (
23
+ Line :: new ( Point :: new ( 8 , 16 + 16 ) , Point :: new ( 8 + 16 , 16 + 16 ) )
24
+ . stroke ( Some ( BinaryColor :: On ) )
25
+ . into_iter ( ) ,
26
+ ) ;
27
+ disp. draw (
28
+ Line :: new ( Point :: new ( 8 , 16 + 16 ) , Point :: new ( 8 + 8 , 16 ) )
29
+ . stroke ( Some ( BinaryColor :: On ) )
30
+ . into_iter ( ) ,
31
+ ) ;
32
+ disp. draw (
33
+ Line :: new ( Point :: new ( 8 + 16 , 16 + 16 ) , Point :: new ( 8 + 8 , 16 ) )
34
+ . stroke ( Some ( BinaryColor :: On ) )
35
+ . into_iter ( ) ,
36
+ ) ;
36
37
37
- disp. draw (
38
- Rectangle :: new ( Point :: new ( 48 , 16 ) , Point :: new ( 48 + 16 , 16 + 16 ) )
39
- . stroke ( Some ( BinaryColor :: On ) )
40
- . into_iter ( ) ,
41
- ) ;
38
+ disp. draw (
39
+ Rectangle :: new ( Point :: new ( 48 , 16 ) , Point :: new ( 48 + 16 , 16 + 16 ) )
40
+ . stroke ( Some ( BinaryColor :: On ) )
41
+ . into_iter ( ) ,
42
+ ) ;
42
43
43
- disp. draw (
44
- Circle :: new ( Point :: new ( 96 , 16 + 8 ) , 8 )
45
- . stroke ( Some ( BinaryColor :: On ) )
46
- . into_iter ( ) ,
47
- ) ;
44
+ disp. draw (
45
+ Circle :: new ( Point :: new ( 96 , 16 + 8 ) , 8 )
46
+ . stroke ( Some ( BinaryColor :: On ) )
47
+ . into_iter ( ) ,
48
+ ) ;
48
49
49
- let local_addr = machine_ip:: get ( ) . unwrap ( ) ;
50
+ let local_addr = machine_ip:: get ( ) . unwrap ( ) ;
50
51
51
- disp. draw (
52
- Font6x8 :: render_str ( & format ! ( "IP: {}" , local_addr. to_string( ) ) )
53
- . translate ( Point :: new ( 0 , 56 ) )
54
- . into_iter ( ) ,
55
- ) ;
56
- disp. flush ( ) . unwrap ( ) ;
52
+ disp. draw (
53
+ Font6x8 :: render_str ( & format ! ( "IP: {}" , local_addr. to_string( ) ) )
54
+ . translate ( Point :: new ( 0 , 56 ) )
55
+ . into_iter ( ) ,
56
+ ) ;
57
+ disp. flush ( ) . unwrap ( ) ;
57
58
58
- sleep ( Duration :: from_secs ( 2 ) ) ;
59
+ sleep ( Duration :: from_secs ( 2 ) ) ;
59
60
60
- disp. clear ( ) ;
61
+ disp. clear ( ) ;
61
62
62
- let im: Image < BinaryColor > =
63
- Image :: new ( include_bytes ! ( "../rust.raw" ) , 64 , 64 ) . translate ( Point :: new ( 32 , 0 ) ) ;
64
- disp. draw ( im. into_iter ( ) ) ;
65
- disp. flush ( ) . unwrap ( ) ;
63
+ let im: Image < BinaryColor > =
64
+ Image :: new ( include_bytes ! ( "../rust.raw" ) , 64 , 64 ) . translate ( Point :: new ( 32 , 0 ) ) ;
65
+ disp. draw ( im. into_iter ( ) ) ;
66
+ disp. flush ( ) . unwrap ( ) ;
67
+
68
+ sleep ( Duration :: from_secs ( 2 ) ) ;
69
+ disp. clear ( ) ;
70
+ }
66
71
}
0 commit comments