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:
- 1:4a358f08c963
- Parent:
- 0:b44e107ade58
- Child:
- 2:4d280faa7d59
--- a/main.cpp Sun Nov 15 14:00:03 2020 +0000
+++ b/main.cpp Sun Nov 15 14:51:28 2020 +0000
@@ -1,10 +1,14 @@
#include "mbed.h"
-//#define USB_DEBUG
-#define SIMPLE_USE
+/* Define */
+//#define USB_DEBUG // xbeeでは送れない量の情報をusb通して送信
+#define SIMPLE_USE // xbeeで情報送信
+
+/* ID */
const int kModuleID = 1;
+/* グローバル変数 */
int sluster_up = 0;
float battery_voltage;
@@ -12,6 +16,7 @@
int sluster_power;
int pump_power;
+/* オフセット */
const float k_vbat_offset[] = {
1.4f,
0.6f
@@ -21,6 +26,7 @@
0.0f
};
+/* ピン設定 */
DigitalOut led[] = {
DigitalOut(PA_4),
DigitalOut(PA_5),
@@ -44,8 +50,10 @@
Serial xbee(USBTX, USBRX);
#endif
+/*タイマー関係設定*/
Ticker pwm;
+/* PWM出力用割り込み関数 */
void myPWM(void)
{
static int t = 0;
@@ -62,6 +70,8 @@
t++;
}
+
+/* xbee or usb シリアル受信時実行関数 */
void SerialReceive(void)
{
char message = xbee.getc();
@@ -105,6 +115,8 @@
led[2] =~ led[2];
}
+
+/* メイン文 */
int main()
{
// Initialization