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: HOSOKIkikou FEP_RX22 QEI R1370 ikarashiMDC_2byte_ver mbed 2022_NHK_B_canTR PID SEKIkikou
Diff: main.cpp
- Revision:
- 0:877aeb04390a
- Child:
- 2:ea17f9e04972
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp Thu Sep 29 08:18:07 2022 +0000
@@ -0,0 +1,46 @@
+#include "mbed.h"
+#include "controller.h"
+#include "pinconfig.h"
+#include "ikarashiMDC.h"
+
+Bcon mycon(fepTX, fepRX, fepad);
+Serial pc(pcTX, pcRX, 115200);
+Serial serial(motorTX, motorRX, 115200);
+DigitalOut stop(stop_pin);
+DigitalOut led(LED2);
+
+ikarashiMDC motor[] = {
+ ikarashiMDC(0,0,SM,&serial),
+ ikarashiMDC(0,1,SM,&serial),
+ ikarashiMDC(0,2,SM,&serial),
+ ikarashiMDC(0,3,SM,&serial)
+};
+
+uint8_t b[8];
+int16_t stick[4];
+
+void recieveController(){
+ for (int i=0; i<8; i++) b[i] = mycon.getButton(i);
+ for (int i=0; i<4; i++) stick[i] = mycon.getStick(i);
+
+ for (int i=0; i<8; i++) pc.printf("%d ", b[i]);
+ pc.printf(" | ");
+ for (int i=0; i<4; i++) pc.printf("%3d ", stick[i]);
+ pc.printf(" | ");
+ if (mycon.status) pc.printf("received\r\n");
+ else pc.printf("anything error...\r\n");
+}
+
+
+int main()
+{
+ mycon.StartReceive();
+ stop = 1;
+ led = 1;
+
+ while(1) {
+
+ //recieveController();
+
+ }
+}
\ No newline at end of file