@@ -47,6 +47,7 @@ private static Hd44780Configuration LoadMcp23008Configuration(IEnumerable<string
47
47
48
48
const Mcp23008Pin registerSelectPin = Mcp23008Pin . Pin1 ;
49
49
const Mcp23008Pin clockPin = Mcp23008Pin . Pin2 ;
50
+ const Mcp23008Pin backlightPin = Mcp23008Pin . Pin7 ;
50
51
51
52
var dataPins = new [ ]
52
53
{
@@ -64,7 +65,7 @@ private static Hd44780Configuration LoadMcp23008Configuration(IEnumerable<string
64
65
Console . WriteLine ( "\t Data 2: {0}" , dataPins [ 1 ] ) ;
65
66
Console . WriteLine ( "\t Data 3: {0}" , dataPins [ 2 ] ) ;
66
67
Console . WriteLine ( "\t Data 4: {0}" , dataPins [ 3 ] ) ;
67
- Console . WriteLine ( "\t Backlight: VCC" ) ;
68
+ Console . WriteLine ( "\t Backlight: {0}" , backlightPin ) ;
68
69
Console . WriteLine ( "\t Read/write: GND" ) ;
69
70
Console . WriteLine ( ) ;
70
71
@@ -74,13 +75,17 @@ private static Hd44780Configuration LoadMcp23008Configuration(IEnumerable<string
74
75
var driver = new I2cDriver ( sdaPin . ToProcessor ( ) , sclPin . ToProcessor ( ) ) { ClockDivider = 512 } ;
75
76
var connection = new Mcp23008I2cConnection ( driver . Connect ( address ) ) ;
76
77
77
- return new Hd44780Configuration ( driver )
78
+ var retVal = new Hd44780Configuration ( driver )
78
79
{
79
80
Pins = new Hd44780Pins (
80
81
connection . Out ( registerSelectPin ) ,
81
82
connection . Out ( clockPin ) ,
82
83
dataPins . Select ( pin => ( IOutputBinaryPin ) connection . Out ( pin ) ) )
83
84
} ;
85
+
86
+ retVal . Pins . Backlight = connection . Out ( backlightPin ) ;
87
+
88
+ return retVal ;
84
89
}
85
90
86
91
private static Hd44780Configuration LoadMcp23017Configuration ( IEnumerable < string > args )
0 commit comments