mirror of
https://github.com/hybridgroup/gobot.git
synced 2025-05-11 19:29:20 +08:00
[gpio] Improve pin logging for RGB LED
Signed-off-by: deadprogram <ron@hybridgroup.com>
This commit is contained in:
parent
b37c656ffe
commit
1897c7f02e
@ -68,8 +68,8 @@ func (l *RgbLedDriver) Halt() (errs []error) { return }
|
||||
// Name returns the LedDrivers name
|
||||
func (l *RgbLedDriver) Name() string { return l.name }
|
||||
|
||||
// Pin returns the RgbLedDrivers redPin
|
||||
func (l *RgbLedDriver) Pin() string { return l.pinRed }
|
||||
// Pin returns the RgbLedDrivers pins
|
||||
func (l *RgbLedDriver) Pin() string { return "r=" + l.pinRed + ", g=" + l.pinGreen + ", b=" + l.pinBlue }
|
||||
|
||||
// RedPin returns the RgbLedDrivers redPin
|
||||
func (l *RgbLedDriver) RedPin() string { return l.pinRed }
|
||||
|
@ -23,7 +23,7 @@ func TestRgbLedDriver(t *testing.T) {
|
||||
d := initTestRgbLedDriver(newGpioTestAdaptor("adaptor"))
|
||||
|
||||
gobottest.Assert(t, d.Name(), "bot")
|
||||
gobottest.Assert(t, d.Pin(), "1")
|
||||
gobottest.Assert(t, d.Pin(), "r=1, g=2, b=3")
|
||||
gobottest.Assert(t, d.RedPin(), "1")
|
||||
gobottest.Assert(t, d.GreenPin(), "2")
|
||||
gobottest.Assert(t, d.BluePin(), "3")
|
||||
|
Loading…
x
Reference in New Issue
Block a user