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:
- 5:526691f54026
- Parent:
- 4:20ee7612edb9
- Child:
- 6:9acaeb5465d2
--- a/main.cpp Fri Nov 04 20:51:47 2016 +0000
+++ b/main.cpp Fri Nov 04 22:23:43 2016 +0000
@@ -14,6 +14,7 @@
#include "ExioMcp23s17.h"
#include "ExioInBuffer.h"
#include "ExioBufferedIn.h"
+#include "ExioBufferedRotaryEncoder.h"
SPI Spi(PC_12, PC_11, PC_10); // SPI3: mosi, miso, sclk
//SPI Spi(PA_7, PA_6, PA_5); // SPI1: mosi, miso, sclk
@@ -92,8 +93,29 @@
}
}
+void testExioBufferedRotaryEncoder()
+{
+ printf("*** Test ExioBufferedRotaryEncoder ***\r\n");
+
+ // Reset MCP23S17 (初期化時にreset()が必要)
+ Exio.reset();
+
+ ExioInBuffer inBufferA(&Exio, ExioPortA);
+ ExioBufferedRotaryEncoder re1(&inBufferA, 0, 1);
+
+ // Start Timers
+ inBufferA.run(5);
+ re1.setInterval(1000);
+
+ while (true) {
+ int v = re1.getVal();
+ printf("%d\r\n", v);
+ }
+}
+
int main()
{
//testExioInBuffer();
- testExioBufferedIn();
+ //testExioBufferedIn();
+ testExioBufferedRotaryEncoder();
}
\ No newline at end of file