demo project

Dependencies:   AX-12A Dynamixel mbed iothub_client EthernetInterface NTPClient ConfigFile SDFileSystem iothub_amqp_transport mbed-rtos proton-c-mbed wolfSSL

Committer:
henryrawas
Date:
Mon Feb 01 21:56:01 2016 +0000
Revision:
26:6def77499117
Parent:
24:f6aa0e64c5e1
Child:
27:4239713d9690
remove terminal

Who changed what in which revision?

UserRevisionLine numberNew contents of line
henryrawas 19:2f0ec9ac1238 1 // Copyright (c) Microsoft. All rights reserved.
henryrawas 19:2f0ec9ac1238 2 // Licensed under the MIT license. See LICENSE file in the project root for full license information.
henryrawas 19:2f0ec9ac1238 3
jepickett 0:547ac906c46b 4 #include "mbed.h"
henryrawas 4:36a4eceb1b7f 5 #include "rtos.h"
henryrawas 4:36a4eceb1b7f 6
henryrawas 18:224289104fc0 7 #include "ControllerIo.h"
henryrawas 7:6723f6887d00 8
henryrawas 4:36a4eceb1b7f 9
henryrawas 13:ffeff9b5e513 10 extern void PrepareController();
henryrawas 7:6723f6887d00 11 extern void RunController();
henryrawas 7:6723f6887d00 12 extern bool StartIothubThread();
henryrawas 4:36a4eceb1b7f 13
jepickett 0:547ac906c46b 14
jepickett 0:547ac906c46b 15 int main()
jepickett 0:547ac906c46b 16 {
henryrawas 26:6def77499117 17 printf("**********************\r\n");
henryrawas 26:6def77499117 18 printf("RobotArmDemo start\r\n");
henryrawas 26:6def77499117 19 printf("**********************\r\n");
jepickett 2:37021fb3b45b 20
henryrawas 10:9b21566a5ddb 21 ShowLedGreen();
henryrawas 4:36a4eceb1b7f 22
henryrawas 13:ffeff9b5e513 23 // prepare the motion sequences
henryrawas 13:ffeff9b5e513 24 PrepareController();
henryrawas 13:ffeff9b5e513 25
henryrawas 4:36a4eceb1b7f 26 // start IotHub connection
henryrawas 4:36a4eceb1b7f 27 StartIothubThread();
jepickett 2:37021fb3b45b 28
henryrawas 4:36a4eceb1b7f 29 // time delay is to allow the position encoders to come online after initial power supply event ~ 5 secs
henryrawas 24:f6aa0e64c5e1 30 Thread::wait(5000);
henryrawas 4:36a4eceb1b7f 31
henryrawas 26:6def77499117 32 printf("Initialization done. Ready to run. \r\n");
jepickett 2:37021fb3b45b 33
henryrawas 13:ffeff9b5e513 34 // try running this thread at a higher priority
henryrawas 13:ffeff9b5e513 35 osThreadId maintid = osThreadGetId();
henryrawas 13:ffeff9b5e513 36 osThreadSetPriority(maintid, osPriorityHigh);
henryrawas 13:ffeff9b5e513 37
henryrawas 7:6723f6887d00 38 RunController();
henryrawas 4:36a4eceb1b7f 39 }