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: mbed NHK2021_ikarashiSV
Diff: main.cpp
- Revision:
- 0:1f76e79805d0
diff -r 000000000000 -r 1f76e79805d0 main.cpp
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Sun Oct 17 13:09:21 2021 +0000
@@ -0,0 +1,28 @@
+#include "mbed.h"
+#include "ikarashiSV.h"
+
+Serial pc(USBTX, USBRX,115200);
+
+ikarashiSV slv(PC_7,PB_10,PB_4,PB_5);
+
+//ボタンを押したときor離したときを読み取る定義の仕方
+InterruptIn button(USER_BUTTON);
+
+void add()
+{
+ slv.add_state();
+}
+
+int main()
+{
+ int val;
+ while(1) {
+ button.fall(&add);
+ val = slv.state_show();
+ pc.printf("\t\tstate : %d",val);
+ if(val >= 1) {
+ slv.solenoid(val%3);
+ }
+ slv.solenoid_show();
+ }
+}
\ No newline at end of file