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:
- 3:783382bcf2ec
- Parent:
- 2:41af46339652
--- a/main.cpp Fri Nov 30 12:10:05 2018 +0000
+++ b/main.cpp Fri Nov 30 12:18:13 2018 +0000
@@ -1,19 +1,13 @@
+/*
+ * This program utilizes max power on the m3pi to measure current
+ * Results: about 7-800 mA when no resistance on motors
+ * about 1000-1100 mA when physical resistance on motors (not stalling)
+ */
#include "mbed.h"
#include "m3pi.h"
m3pi m3pi;
-// Minimum and maximum motor speeds
-#define MAX 1.0
-#define MIN 0
-
-//Our variables
-#define OPTIMAL_SPEED 0.8
-
-// PID terms
-#define P_TERM 1.0
-#define D_TERM 8.0
-#define I_TERM 0.01 //skal være nul eller tæt på
//Print to LCD (character, line) numbers are zero indexed
void print_battery() {
@@ -29,14 +23,6 @@
m3pi.printf(text);
}
-void toggleLED(DigitalOut &led) {
- if (led == 1) {
- led = 0;
- } else {
- led = 1;
- }
-}
-
int main(void) {
