From b1ae5ff78ee97d22318261b9e326c44b6599523d Mon Sep 17 00:00:00 2001 From: Roland Kajatin Date: Sat, 1 Oct 2016 15:33:13 +0200 Subject: [PATCH] Concatenating strings For me, the IDE couldn't concatenate the int types with strings. So I had to create 3 strings and concatenate them. --- .../read_joint_positions/read_joint_positions.ino | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Crust Crawler Arms/read_joint_positions/read_joint_positions.ino b/Crust Crawler Arms/read_joint_positions/read_joint_positions.ino index a017e74..917ddef 100644 --- a/Crust Crawler Arms/read_joint_positions/read_joint_positions.ino +++ b/Crust Crawler Arms/read_joint_positions/read_joint_positions.ino @@ -34,8 +34,10 @@ void loop(){ // and send it to the PC. for(int i = 1; i < 6; ++i){ int pos = GetPosition(i); - String report; - report = i + ": " + pos; + String servo=String(i); + String text=String(": "); + String posit=String(pos); + String report = String(servo+text+posit); Serial.println(report); }