4180 LabTeam - Spring '18 / Mbed 2 deprecated Lab1_Part72

Dependencies:   MCP23S17 mbed

Fork of MCP23S17_Basic_IO_Demo by jim hamblen

Revision:
6:9f1bf46845ab
Parent:
5:ec6bfed1bada
Child:
7:2e7fe8cc61fc
--- a/main.cpp	Wed Jan 31 06:19:25 2018 +0000
+++ b/main.cpp	Wed Jan 31 06:22:29 2018 +0000
@@ -50,7 +50,8 @@
 //  Start Loopback test sending out and reading back values
 //  loopback test uses A0 and B0 pins - so use a wire to jumper those two pins on MCP23S17 together
     while (1) {
-        B0 = chip.read(PORT_B)& 0x01;
+        B0 = !(chip.read(PORT_B)& 0x01);
+        
         chip.write(PORT_A,B0);
         //    chip.write(PORT_A,0); // turn off LED
         // write 0xAA to MCP23S17 Port A