Outher...Miura Souta
Revision 3:8790e69f8c59, committed 2020-01-24
- Comitter:
- M_souta
- Date:
- Fri Jan 24 11:26:29 2020 +0000
- Parent:
- 2:32d2cd7d744b
- Child:
- 4:15547d07f8e5
- Commit message:
- lll;
Changed in this revision
| Motor/Motor.h | Show annotated file Show diff for this revision Revisions of this file |
| main.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/Motor/Motor.h Thu Jan 23 09:16:38 2020 +0000
+++ b/Motor/Motor.h Fri Jan 24 11:26:29 2020 +0000
@@ -25,8 +25,8 @@
#define MOTOR4_D2 directions[9]
#define MOTOR0_D1_PIN D3
- #define MOTOR0_D2_PIN D4
- #define MOTOR1_D1_PIN D5
+ #define MOTOR0_D2_PIN A4
+ #define MOTOR1_D1_PIN A5
#define MOTOR1_D2_PIN D6
#define MOTOR2_D1_PIN D8
#define MOTOR2_D2_PIN D9
--- a/main.cpp Thu Jan 23 09:16:38 2020 +0000
+++ b/main.cpp Fri Jan 24 11:26:29 2020 +0000
@@ -2,49 +2,46 @@
#include "Motor.h"
#include "MCP.h"
#include "XBee.h"
+#include <stdint.h>
#define SDA PB_7
#define SCL PB_6
#define MCP_ADDRESS 0x40
-using namespace MOTOR
-
MCP MCP(SDA, SCL, MCP_ADDRESS);
-
-Serial pc(USBTX, USBRX);
-
XBEE::ControllerData *controller;
MOTOR::MotorStatus motor[MOUNTING_MOTOR_NUM];
+/* ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
+
+
+
+/* ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
+
int main() {
- __enable_irq();
-
+ XBEE::Controller::Initialize();
MOTOR::Motor::Initialize();
- MCP.PinMode(7, INPUT_PULLUP);
- MCP.PinMode(6, OUTPUT);
+ __enable_irq();
+
+ /* ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
+
+ /* ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
+
while(1) {
+
controller = XBEE::Controller::GetData();
-
MCP.Update();
- int a;
+ /* ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
+
- /* write ↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓ */
- for(int i = 0; i < 16; i++) {
- a = MCP.Read(i);
- pc.printf("%d",a);
- }
- pc.printf("\n\r");
- int b = MCP.Read(7);
+ /* ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ */
- MCP.Write(6, b);
-
- //
MOTOR::Motor::Update(motor);
}
}