Driver to read switches, one at a time or an entire dip-sw

Dependents:   input dip_switch dipsw_change input ... more

Revision:
1:dfb1302f847d
Parent:
0:8e569e04a0fb
diff -r 8e569e04a0fb -r dfb1302f847d Hotboards_switches.cpp
--- 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;
 }