Driver to read switches, one at a time or an entire dip-sw
Dependents: input dip_switch dipsw_change input ... more
Diff: Hotboards_switches.cpp
- Revision:
- 1:dfb1302f847d
- Parent:
- 0:8e569e04a0fb
--- a/Hotboards_switches.cpp Sun Feb 28 01:32:55 2016 +0000 +++ b/Hotboards_switches.cpp Tue Mar 01 03:40:45 2016 +0000 @@ -135,12 +135,12 @@ void Hotboards_switches::begin( uint8_t sw, PinName pin ) { - _sw[ sw ] = new DigitalIn( pin );; + _sw[ sw ] = new DigitalIn( pin ); } bool Hotboards_switches::readSw( uint8_t sw ) { - bool val = _sw[ sw ]; + bool val = _sw[ sw ]->read(); if( _close == 0 ) val = !val; return val; }