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.
Diff: main.cpp
- Revision:
- 6:019ab407ac3c
- Parent:
- 5:daab0e0e67e2
- Child:
- 8:2554218db1e6
diff -r daab0e0e67e2 -r 019ab407ac3c main.cpp --- a/main.cpp Fri Jan 22 14:06:54 2021 +0000 +++ b/main.cpp Mon Jan 25 13:21:57 2021 +0000 @@ -1,16 +1,26 @@ #include "mbed.h" -#include "i2c_mbed_fpga.h" #include "main_init.h" -//#include "serial_fsm.h" - +#include "i2c_mbed_fpga.h" /* Main function */ int main() { - + + /*init funcitons*/ i2c_mbed_fpga i2c; - main_init(); + main_init(); /*reset the FPGA!*/ + /*control codes*/ + wait_ms(5000); /* keep FPGA in reset for 5s, to let motor stop*/ + enbale_fpga(); /* enable FPGA */ + led4 = i2c.i2c_window_open(); /*send password 0xd0d0*/ + wait_ms(1000); + //i2c.i2c_set_position_pulse_width(3,4); /*unsigned int mantisaa_2b, unsigned int exponent_3b*/ + led4 = i2c.i2c_set_soft_start_up(0, 1, 0, 1, 1); + wait_ms(1000); + led4 = i2c.i2c_motor_start(); /*send password 0xcafe*/ + + /*enter infinite loop, motor should be running*/ while (1) {} } \ No newline at end of file