A sequence of characters -- including letters, numbers and symbols -- often used for representing information in a human-readable format.
0
votes
0answers
30 views
How to split a string in substring? [duplicate]
I have a python background and know how to do string manipulations there. Coming to arduino (C++) I kind of doesn't feel comfortable doing simple stuff that I know in python because it's more low ...
0
votes
3answers
15 views
Merging strings and constants causing scope errors
I'm getting a few errors when merging strings with constants.
Here's the pertinent code...
#define STATION_ID ABC123
#define STATION_PASS XYZ987
void loop(){
String path = "/weatherstation/...
0
votes
1answer
25 views
eval() function for arduino?
i plan to do the following:
void setup(){
String term = "12 + (2 * 5)";
int result = eval(term); // eval function (from python)
Serial.println(result); // expect 22
}
however there is no ...
0
votes
1answer
24 views
two dimensional array with 3 characters per entry?
my plan is to create a two dimensional array with 3 characters in each cell.
what i have tried:
char keys[3][8][8] = {
{' ','4','5','6','x','/',' ',' '},
{'x10','7','8','9',' ',' ',' ',' '},
{'...
0
votes
1answer
35 views
Difficulties with raw string literals
I have an application where I would like to include an external multiline script as a const in my sketch. As far as I understand from C++11, this should work:
raw_string_literal_test.ino
const char *...
1
vote
1answer
28 views
strtok problem while parsing String
Here is my code. The incoming string is "*CRB12344,Temp25,Humidity55,CC5#"
I am unable to get value of Temp which is 25 and Humidity which is 55 and CC which 5. It only display the value of CR i.e ...
1
vote
1answer
21 views
Arduino SSCANF stop on comma delimiter
I have the following problem, the arduino is receiving a command like
LCD,Display line text one, Display line text two
I use an strcmp to match the beginning of the string that works but now I would ...
2
votes
1answer
30 views
Blank.txt at the End of Transmission
I'm using my HC-05 (Master) to receive strings from a sensor (Slave), each string is suppose to have 7 items divided by ',' like so "a,b,c,d,e,f,g". I also have to write these strings in a .txt file ...
-4
votes
0answers
36 views
How to display a variable on OLED NodeMCU
I'm using OLED.h library to display on the OLED. I'm not able to display a variable on OLED.
Below is my code
#include <Wire.h>
#include <math.h>
#include "OLED.h"
OLED display(4,5);
...
1
vote
0answers
42 views
save bytes from Serial into ROM (EEPROM)
i am trying to save an incomming text from serial into the rom of the arduino using EEPROM. I found out that you can only save a byte at once. So i thought i could do it like that:
#include <...
1
vote
2answers
30 views
Why do i get additional characters when reading a file through a buffer if buffer size > 15?
This is a follow up question to How to speed up writing a file to a WifiClient?
I modified the old code to read from one Stream and write to another which looked like this and worked fine albite ...
-1
votes
1answer
23 views
Replacing stock String.cpp with smaller version
Hey all I am wondering if it's possible to modify the WString.cpp file to only include the commands that I need for my project since that file is so large.
I am using a Digispark arduino that is ...
3
votes
3answers
75 views
How to multiply strings?
I want to have a line like this
Serial.println(count*"B");
So if count=6, it would print BBBBBB, etc.
Is there anything like this for arduino?
-1
votes
1answer
32 views
Including string class in Eclipse Neon
Probably basic question but when I type include in class of my arduino project I get only error. How do I properly include this string class?
1
vote
1answer
62 views
Serial Communication Not Receiving Entire String
I have an Arduino connected to a pico motor driver that is supposed to take a number of steps for a specific number of triggers that gets from a source (i.e. waveform generator). I've setup the code ...
0
votes
1answer
56 views
Converting uint8_t to String - unexpected result
I'm working on a remote control code for ESP controller. Using ESPwebserver and Fastled. When I try to return a value of an uint8_t, as a POST response, i got strange result here is the relevant code:
...
0
votes
1answer
34 views
check string for specific characters?
I am just wondering if it is possible to check a string for specific characters. For example if my string is String mystr = "test"; and I wanted to check for the letter t at the beginning and if it ...
0
votes
2answers
27 views
Nano resets or freezes on calling a function
I'm controlling a light bulb with my Arduino Nano from serial or RF (via nRF24L01+) and I'm passing the commands as a string. After I get all the variables (3 ints) I try calling the function ...
2
votes
2answers
55 views
Help with a Memory Issue
Below is some code that I'm writing to concurrently run "animations" on the same strip of NeoPixels. When I try to make use of the Serial monitor to control the program functions, I just get a bunch ...
3
votes
2answers
65 views
Understanding memory fragmentation due to char arrays in functions
This is similar to:
Is this function subject to memory fragmentation?
I am trying to get my head around Memory fragmentation in Arduino's and embedded systems in general.
Currently I have a ...
0
votes
2answers
64 views
The most effective way to format numbers on Arduino
I made a big search about how to Format Numbers with the Arduino. I want to format unsigned Longs into a String in this format: "23,854,972".
The most of the snippets I found work only with the ...
1
vote
1answer
184 views
Parse HTTP Request Arduino
I am sending a HTTP Request to my WiFi module http://192.168.4.1/STA/ID=HelloWorld/Pass=Testin123
How can I parse above string in Arduino. First I need to check for STA, if it exists, continue to ...
1
vote
1answer
51 views
Declaring literal strings
When I want to write a literal string in Python, I use r before the string (or @ in C#):
in [1]: print r'\no esca\pe ch\ara\cters'
out [1]: \no esca\pe ch\ara\cters
In straight c++ I can use R, but ...
0
votes
1answer
36 views
WebSocket client for ArduinoHttpClient conditional if with readString() incoming data buffer
I'm having issues implementing a web socket on the Arduino/Genuino to procress a string received and do something respectively.
I'm using SimpleWebSocket example, edited for my purpose, from the ...
1
vote
5answers
200 views
Is possible to concatenate integers?
It's a basic one: I have two values from two different analogRead pins:
int val1;
int val2;
For example, val1 = 10 and val2 = 10. How could I put these two values into a variable val3 = val1 + val2 ...
0
votes
1answer
122 views
Size of String array
I am trying to find out the size of an array like this:
String days[3] = { "Mon", "Tue", "Wed" };
Serial.printf("Size of array: %2d\n", sizeof(days));
for (int i = 0; i < sizeof(days); i++) {
...
3
votes
1answer
47 views
Informations lost in a string
At first, I sorry if I make some English faults but I'm French.
So, I'm making a connection between a client and an Arduino Uno. I receive all data that I need but when I send a response to my ...
0
votes
0answers
236 views
Parsing GET function + ESP8266 + ARDUINO IDE
I am working on a ESP and making it a simple Http web server. I have successfully ON/OFF the led using the browser. I need to use PWM, instead of Switching the led. As of now When I hit http://192.168....
0
votes
0answers
102 views
Arduino UNO stops working after a while - SOLVED
So I was looking after this problem of course, but I cannot guess what the problem can be.
I am using Arduino UNO with a matrix module and it after I upload the program it works correctly always for ...
1
vote
1answer
623 views
How to convert String to Double?
I found the .toFloat() but that's not accurate enough.
String StrEx = "57.10598";
float FloatEx = StrEx.toFloat();
Serial.println(String(FloatEx)); //outputs 57.11
Serial.println(StrEx); //...
0
votes
1answer
153 views
how to send large strings (> 100 characters) from arduino serial monitor
I am a newbie to arduino programming. I wish to send big strings which are in range of 100 to 1000 characters to my arduino uno. I saw that arduino cannot read more than 63 characters at a time.
The ...
0
votes
1answer
242 views
Remove certain characters from char*
I've got an array of char* with serial data that I'm trying to remove ':' from. I have tried to iterate through the char*, find and remove any colons but it just comes out as garbage.
char* espData[...
0
votes
1answer
90 views
Arduino: put string through variable in array
I have a problem and I can't fix it.
I'm busy with an java to arduino project.
Java writes a string using writeString();
Arduino reads the serial monitor and put the incoming string into a function.
...
0
votes
0answers
281 views
Using Sprintf() to left pad a string?
I've been at this all day, and I just can't seem to wrap my mind around how to use sprintf() to set a width for my string so that my characters are right justified.
What I'm trying to do is scooch ...
0
votes
1answer
468 views
convert String to unsigned long long
i want to convert string for example
"68976543210" to unsigned long long(64 bit) in mega2560,
do is possible?
String x="68976543210";
unsigned long long y=?;
0
votes
1answer
36 views
error loading an array of strings
I'm trying to have a user enter a series of strings. This is my code.
this is my error message - cannot convert 'String' to 'char*' in assignment
char* titles[] = {"entry one", "entry two", "entry ...
0
votes
1answer
87 views
Strings that always stay empty
I wrote an app that listens on the network for command over UDP and sends back an answer. Whatever I try to put into my answer never get sent. The string is always empty. The following code prints a ...
0
votes
3answers
50 views
I need to build a char array from two integers
My C is rusty, so please forgive this simple problem.
This line works:
Tft.drawString("Test",200,200,2,WHITE);
But, this has compile errors:
String yStr = "Test";
Tft.drawString(yStr,200,200,2,...
0
votes
1answer
181 views
Split string into an array of string
I have a SIM900 module connected to an Arduino Uno, using an AT command for listing the SMS I get this output, how can i split this based on (,) to store each data in an array?
AT+CMGL="ALL"
+CMGL: ...
0
votes
1answer
49 views
build fixed size strings from floats
This is likely a duplicate, but I couldn't find the original question. This is really basic, but just can't figure it out.
I'm trying to combine a few char arrays together. This is what I've tried so ...
0
votes
1answer
59 views
Find number in a reply returned via serial
I am communicating with my GoPro via ESP8266 and GET requests.
One of the replies returns a set of predefined number and what I would like to do is extract the number on position "38". This is what ...
0
votes
1answer
19 views
Drop alpha character from serial input
I receive strings over the serial port like so:
VLT=53.0, AMP=-30.2, AHR=-10, SOC=98, TMP=136, STS=192
I want to reduce the use of string functions with the idea of dropping all non-digits, keeping ...
1
vote
1answer
27 views
Why is the result shorter than expected when I do longString.toCharArray(bigCharArr, longLength)?
I'm running this on a Particle Photon, but I think the issue is just me failing at C++. I'm trying to retrieve some JSON data from a HTTP API, convert it to JSON, and then extract a few values for ...
1
vote
2answers
34 views
Serial Data Formatting not Correct?
I am writing two Arduino Uno programs. One is a remote with a joystick and the other has five LED's indicating which direction the joystick is pointing. They are Bluetooth, so everything is sent and ...
-1
votes
1answer
14 views
Join Serial Data Seperated by Newlines?
I have two Arduinos connected through Bluetooth. One sends a string of data similar to 506:507:1\r\n. The data can vary similar to 0:1000:0\r\n. I already have functions to break that string down into ...
1
vote
1answer
250 views
Extracting a substring from original string
I am trying to extract a substring out of another string, but it doesn't seem to be working. I am new to programming in arduino and c++ in general. Here is my code:
void setup()
{
Serial.begin(...
1
vote
2answers
194 views
Get strings from Serial.read()
I want to read strings from Serial.read() to send them later.
To get the data from the Serial monitor I'm doing this:
String stringOne = "";
int incomingByte;
if (Serial.available() > 0) {
...
0
votes
1answer
51 views
Arduino join multiple strings and numbers and then seperate them
OK, I'm working on a remote controlled robot. Both the robot and the remote use Arduino with a Bluetooth shield. The Bluetooth is working and I need to send something similar to this over Bluetooth:
...
0
votes
1answer
93 views
How to convert array of chars to array of ints?
I have a rather newbie question but I can't figure it out.
Lets say I have this char array:
char array[] = "10,11,12,1,0,1,0";
How can I convert it to an array of int like this?
int arrayINT[] =...
0
votes
1answer
3k views
How to convert String to byte array
I have the code, it's purpose is to receive the string from a comport like:
Set@1234567890123456@1234567890123456@1234567890123456@1234567890123456
and translate it into four byte arrays byte user1[16]...