Start of a microbit mpr121 library
Dependents: microbitmpr121-example
Revision 8:cda72c6b04c0, committed 2017-01-16
- Comitter:
- owenbrotherwood
- Date:
- Mon Jan 16 23:02:19 2017 +0000
- Parent:
- 7:ac942cee2975
- Commit message:
- ok;
Changed in this revision
MicroBitMpr121.cpp | Show annotated file Show diff for this revision Revisions of this file |
MicroBitMpr121.h | Show annotated file Show diff for this revision Revisions of this file |
diff -r ac942cee2975 -r cda72c6b04c0 MicroBitMpr121.cpp --- a/MicroBitMpr121.cpp Mon Jan 16 21:58:16 2017 +0000 +++ b/MicroBitMpr121.cpp Mon Jan 16 23:02:19 2017 +0000 @@ -101,10 +101,11 @@ return; } -void MicroBitMpr121::registerDump() const // What is the const purpose +void MicroBitMpr121::registerDump() { - for(int i=0; i<0x80; i++) { - printf("Reg 0x%02x: 0x%02x \n", i, MicroBitMpr121::read8(uint8_t(i)); + for(uint8_t i=0; i<0x80; i++) { + int response = read8(i); + printf("Reg 0x%02x: 0x%02x \n", i, response); } return; }
diff -r ac942cee2975 -r cda72c6b04c0 MicroBitMpr121.h --- a/MicroBitMpr121.h Mon Jan 16 21:58:16 2017 +0000 +++ b/MicroBitMpr121.h Mon Jan 16 23:02:19 2017 +0000 @@ -163,7 +163,7 @@ /** print the register map and values to the console */ - void registerDump() const; + void registerDump(); /** * Stop the IC and put into low power mode