Skip to content

Commit 80fdc6f

Browse files
committed
Add more example to Teleplot
1 parent 5a63bfb commit 80fdc6f

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

examples/Example6_Teleplot/Example6_Teleplot.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,17 +20,25 @@ void setup(void)
2020
Printer::teleplotUDPEnable = Enable::ENABLE_TRUE;
2121
}
2222

23-
int32_t cpt = 0;
23+
static int32_t cpt = 0;
2424
Point point = Point(0, 0);
25+
PoseF pose = PoseF(0.0f, 0.0f, 0.0f);
26+
int64_t timeSinceBoot = 0;
2527

2628
void loop(void)
2729
{
2830
// This will be send over Wifi if enable and also on Serial
2931
println("Hello World %i times !", cpt++);
3032
point.x = cpt + cpt;
3133
point.y = cpt * cpt;
34+
pose.x = cpt / 3.0f;
35+
pose.y = cpt * 1.2f;
36+
pose.h = pose.x + pose.y;
3237
delay(1000);
38+
timeSinceBoot = esp_timer_get_time();
3339

40+
teleplot("time", timeSinceBoot);
3441
teleplot("cpt", cpt);
3542
teleplot("point", point);
43+
teleplot("pose", pose);
3644
}

src/Printer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ Format Specifier
237237
if (teleplotUDP.IsInitialized())
238238
teleplotUDP.update(varName.c_str(), var);
239239
else
240-
println(">" + varName + ":" + String(var));
240+
println(">%s:%f", varName, var);
241241
}
242242

243243
void teleplot(const String &varName, Point point)

0 commit comments

Comments
 (0)