aaa

Dependencies:   mbed

main.cpp

Committer:
igarashi50
Date:
2018-05-20
Revision:
0:1851b5122ec9

File content as of revision 0:1851b5122ec9:

#include "mbed.h"

#define MOTOR_ADDRESS 0xC8

Serial pc(USBTX,USBRX);
I2C motor(p28, p27);
char cmd[3];

int main()
{
    pc.printf("start\r\n");
    motor.frequency(100000);
    cmd[0] = 0xC8;
    cmd[1] = 0x00;
    cmd[2] = 0x49;
    motor.write(MOTOR_ADDRESS,cmd,3);
    pc.printf("end\r\n");
}