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.
main.cpp@1:2594a70c1ddd, 2021-05-26 (annotated)
- Committer:
- _seminahn
- Date:
- Wed May 26 05:26:16 2021 +0000
- Revision:
- 1:2594a70c1ddd
- Parent:
- 0:4ff8aeb3e4d1
- Child:
- 2:0de4854743f7
sonar num 11 -> 10
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| _seminahn | 0:4ff8aeb3e4d1 | 1 | /* mbed Microcontroller Library |
| _seminahn | 0:4ff8aeb3e4d1 | 2 | * Copyright (c) 2019 ARM Limited |
| _seminahn | 0:4ff8aeb3e4d1 | 3 | * SPDX-License-Identifier: Apache-2.0 |
| _seminahn | 0:4ff8aeb3e4d1 | 4 | * |
| _seminahn | 0:4ff8aeb3e4d1 | 5 | * 20201024 Thread example : |
| _seminahn | 0:4ff8aeb3e4d1 | 6 | * got from https://os.mbed.com/docs/mbed-os/v6.3/apis/thread.html |
| _seminahn | 0:4ff8aeb3e4d1 | 7 | */ |
| _seminahn | 0:4ff8aeb3e4d1 | 8 | #include "mbedHeader.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 9 | #include "robotConfig.h" |
| _seminahn | 0:4ff8aeb3e4d1 | 10 | #include "rosHeader.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 11 | #include "moduleHeader.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 12 | #include "defineHeader.h" |
| _seminahn | 0:4ff8aeb3e4d1 | 13 | #include "instanceHeader.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 14 | #include "myUtil.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 15 | #include "globalVariable.h" |
| _seminahn | 0:4ff8aeb3e4d1 | 16 | #include "initFunction.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 17 | #include "threadDeclaration.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 18 | #include "callbackHeader.hpp" |
| _seminahn | 0:4ff8aeb3e4d1 | 19 | |
| _seminahn | 0:4ff8aeb3e4d1 | 20 | /* function protopytes begin ------------------------------------------------ */ |
| _seminahn | 0:4ff8aeb3e4d1 | 21 | |
| _seminahn | 0:4ff8aeb3e4d1 | 22 | /* function protopytes end -------------------------------------------------- */ |
| _seminahn | 0:4ff8aeb3e4d1 | 23 | |
| _seminahn | 0:4ff8aeb3e4d1 | 24 | |
| _seminahn | 0:4ff8aeb3e4d1 | 25 | /* Instancs begin ----------------------------------------------------------- */ |
| _seminahn | 1:2594a70c1ddd | 26 | #ifdef NO_ROS |
| _seminahn | 0:4ff8aeb3e4d1 | 27 | mbed::Serial pc(USBTX, USBRX); |
| _seminahn | 0:4ff8aeb3e4d1 | 28 | #else |
| _seminahn | 0:4ff8aeb3e4d1 | 29 | ros::NodeHandle nh; |
| _seminahn | 0:4ff8aeb3e4d1 | 30 | #endif |
| _seminahn | 0:4ff8aeb3e4d1 | 31 | //MODULE module(BOOSTPUMP_PIN, SOLENOID_PIN, PURIFIER_PWM_PIN, PURIFIER_BR_PIN, UVC_PIN); |
| _seminahn | 1:2594a70c1ddd | 32 | //UVC uvc(UVC_P, UVC_N); |
| _seminahn | 0:4ff8aeb3e4d1 | 33 | Serial bt(BT_TX,BT_RX); |
| _seminahn | 0:4ff8aeb3e4d1 | 34 | #define CALIBRATION_MODE 1 |
| _seminahn | 0:4ff8aeb3e4d1 | 35 | /* Instancs end ------------------------------------------------------------- */ |
| _seminahn | 0:4ff8aeb3e4d1 | 36 | int main() { |
| _seminahn | 0:4ff8aeb3e4d1 | 37 | SystemCoreClockUpdate(); |
| _seminahn | 0:4ff8aeb3e4d1 | 38 | #if (NO_ROS) |
| _seminahn | 0:4ff8aeb3e4d1 | 39 | initSerial(); |
| _seminahn | 0:4ff8aeb3e4d1 | 40 | //pc.printf("- Start of Program. CPU SystemCoreClock is %d Hz\r\n", SystemCoreClock); |
| _seminahn | 0:4ff8aeb3e4d1 | 41 | #else |
| _seminahn | 0:4ff8aeb3e4d1 | 42 | initROS(); |
| _seminahn | 0:4ff8aeb3e4d1 | 43 | #endif |
| _seminahn | 1:2594a70c1ddd | 44 | initBT(); |
| _seminahn | 0:4ff8aeb3e4d1 | 45 | initThread(); |
| _seminahn | 0:4ff8aeb3e4d1 | 46 | while(1) {;} |
| _seminahn | 0:4ff8aeb3e4d1 | 47 | #if (NO_ROS) |
| _seminahn | 0:4ff8aeb3e4d1 | 48 | pc.printf("- End of Program\r\n"); |
| _seminahn | 0:4ff8aeb3e4d1 | 49 | #endif |
| _seminahn | 0:4ff8aeb3e4d1 | 50 | return 0; |
| _seminahn | 0:4ff8aeb3e4d1 | 51 | } |
| _seminahn | 0:4ff8aeb3e4d1 | 52 | |
| _seminahn | 0:4ff8aeb3e4d1 | 53 | /***** EOF *****/ |