Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: ExioBufferdController MCP23S17 mbed-rtos mbed
Diff: main.cpp
- Revision:
- 13:219ff2cfa3c3
- Parent:
- 11:325c5e9d28e2
diff -r ca2515dbe3ab -r 219ff2cfa3c3 main.cpp
--- a/main.cpp Sat Nov 05 00:45:42 2016 +0000
+++ b/main.cpp Fri Jan 06 04:34:43 2017 +0000
@@ -4,6 +4,7 @@
* mbed: revison 121
* mbed-rtos: revision 117
*
+ * 2017.01.06 for BaseMachine ExioBoard
* Created: 2016.11.05
*
*/
@@ -242,6 +243,8 @@
pinA7.setAssertValue(0);
// DebounceIn
+ ExioBufferedDebounceIn pinA2(&inBufferA, 2);
+ ExioBufferedDebounceIn pinA3(&inBufferA, 3);
ExioBufferedDebounceIn pinA4(&inBufferA, 4);
ExioBufferedDebounceIn pinA5(&inBufferA, 5);
@@ -258,7 +261,7 @@
// Rotary Encoder
ExioBufferedRotaryEncoder re1(&inBufferA, 0, 1);
- ExioBufferedRotaryEncoder re2(&inBufferA, 2, 3);
+ //ExioBufferedRotaryEncoder re2(&inBufferA, 2, 3);
// Start Timers for polling MCP23S17
inBufferA.run(5);
@@ -269,6 +272,8 @@
pinA7.setSampleFrequency(10000);
// Start Timers for DebounceIn
+ pinA2.set_debounce_us(10000);
+ pinA3.set_debounce_us(10000);
pinA4.set_debounce_us(10000);
pinA5.set_debounce_us(10000);
for (int i = 0; i < 8; i++) {
@@ -277,14 +282,16 @@
// Start Timers for RotaryEncoder
re1.setInterval(1000);
- re2.setInterval(1000);
+ //re2.setInterval(1000);
while(true) {
+ int va2 = pinA2.read();
+ int va3 = pinA3.read();
int va4 = pinA4.read();
int va5 = pinA5.read();
int vre1 = re1.getVal();
- int vre2 = re2.getVal();
- printf(" A4:%d A5:%d state:%d count:%d RE1:%d RE2:%d ", va4, va5, state, count, vre1, vre2);
+ //int vre2 = re2.getVal();
+ printf(" A2:%d A3:%d A4:%d A5:%d state:%d count:%d RE1:%d ", va2, va3, va4, va5, state, count, vre1);
for (int i = 0; i < 8; i++) {
int vb = inB[i].read();
printf("%d ", vb);