Skip to main content

Questions tagged [string]

A sequence of characters -- including letters, numbers and symbols -- often used for representing information in a human-readable format.

Filter by
Sorted by
Tagged with
0 votes
1 answer
119 views

I am running a project where I have multiple ESP32s communicate over WebSockets and I am using the Arduino IDE 2.3.4 for it. The communication primarily uses JSON and sends it as strings. To work with ...
Joel's user avatar
  • 103
5 votes
1 answer
239 views

On my ESP32 I am trying to connect to my HomeAssistant server using ArduinoHA library. I can easily connect when hard-coding the credentials: mqtt.begin("server", "username", "...
SagiZiv's user avatar
  • 201
-1 votes
1 answer
46 views

I wrote code for my transmitter Arduino. I want to send the data to the receiver Arduino through Tx and Rx serial. The issue is that I could not discard the char "T" and it appears as output ...
anwar alfawdaei's user avatar
0 votes
1 answer
534 views

I'm attempting to save a string to EEPROM of an ESP8266 radio and then read it back before I encrypt the data (evenutally I would like to save the encrypted data but I'm simplifing things at the ...
PhippsTech's user avatar
0 votes
1 answer
2k views

I am printing some ASCII art to the Serial monitor from Arduino UNO, with some success. However, using string literals uses more memory than I would like. I wanted to try constructing the strings/...
Hubert B's user avatar
-1 votes
1 answer
102 views

I'm using an Arduino Mega 2560 and writing a really simple piece of code that doesn't work. String a, letra; #define led 13 void setup() { Serial.begin(9600); // opens serial port, sets data rate ...
Carlos Eduardo Carvalho's user avatar
1 vote
1 answer
1k views

I have to handle a String coming in over UART containing a bunch of information, part of it is a MAC-address that I get by using String.substring(a, b) returning a 12-char String representing a mac-...
Harald Lesan's user avatar
1 vote
0 answers
128 views

I'm trying to follow Serial Input Basics to build a program which receives commands over serial like "<led:12,34,21>" but i'm stuck on receiving the characters from serial... I have ...
Taako's user avatar
  • 111
3 votes
1 answer
2k views

Code Snippet: String a; const int red_led_pin = 13; void setup() { Serial.begin(115200); Serial.println("Hello, ESP32-S2!"); pinMode(red_led_pin, OUTPUT); } void loop() { ...
3kstc's user avatar
  • 221
-1 votes
1 answer
668 views

String str = {"timestamp": "2023-02-08 16-37-31" ,"cpcb_device": [{"Station" : "832","Para": [{"tag_name": "COD","...
Karan Bawadekar's user avatar
0 votes
2 answers
479 views

I am trying to move a stepper motor when a specific command is send to Arduino Mega 2560. This command is read character by character and stored in a string variable. Whenever a new command is sent, ...
Yan Araújo's user avatar
0 votes
1 answer
167 views

I am developing a hangman game on tinyduino(tinycircuits) and I am currently stuck on how to properly replace a char based on user input within a for loop. My current code does actually replace the ...
Isaac Agatep's user avatar
0 votes
2 answers
104 views

I am trying to make a drop down selection with gyverportal. The issue is that I don't know how many items there are so the list cannot be hard coded. Here is an example from github: GP.SELECT("...
Gerge's user avatar
  • 1
2 votes
1 answer
140 views

Just started out with tinyduino(tinycircuits) and I am trying to develop a hangman game. I have this chunk of code that randomly picks a word from my array. I've omitted some code for readability. ...
Isaac Agatep's user avatar
2 votes
0 answers
361 views

I just wrote some code that just sends a string from Arduino to Processing. Processing prints the string and displays the number of characters in the buffer... After uploading the sketch to the ...
Robot12's user avatar
  • 21
0 votes
0 answers
730 views

I'm trying to transfer a monochrome ~4kb image file over WebBT to an ESP32 via BLE. The EPD display looks for an unsigned char array to represent a bitmap. So..it should be in the format of something ...
user2402616's user avatar
0 votes
2 answers
856 views

I am newbie in Arduino and writing a program where I want to control the flow by using Serial monitor input (PI controller). I've read that using String() although easier it is slower than using char. ...
Ognyan Petkov's user avatar
1 vote
2 answers
383 views

New to Arduino, getting into String variables and reading them from serial monitor. Basically what I'm trying to do is have the user input either red, green, yellow. Whichever String they enter the ...
Moose's user avatar
  • 9
2 votes
1 answer
1k views

I want to use snprintf() to format floats to a string. I know the "normal" version of Arduino's avrlibc had all the float-formatting code removed to make it smaller. I also know that at some ...
Bitbang3r's user avatar
  • 561
0 votes
1 answer
264 views

I am trying to compare two string but each time i am getting awkward results. When i use Equals() function i always get the wrong answer and never satisfy the IF statement. When i use compareTo() ...
ASAD ALI's user avatar
1 vote
1 answer
9k views

I am sending a string from a Raspberry Pi to an ESP32 via BT. I am getting one ASCII value per line. How to convert it into one whole String? I tried as follows, but I get an error while running the ...
matmagdt's user avatar
2 votes
2 answers
83 views

I have created a code that should print out "Enter true to deactivate alarm" in the serial monitor, then store the user's answer and print "alarm off" if they enter true and "...
Jillian's user avatar
  • 21
0 votes
3 answers
1k views

I want to replace the ":"(colon) in the MAC address with no char (remove the ":"). But I can't find any good solution. String.replace(), can't replace with (void). Note: String....
Instigator's user avatar
2 votes
2 answers
1k views

I need to implement EEPROM Read & Write functionality to my project. I've been learning how to use the EEPROM on the last few days, however I'm struggling to Read & Write Strings to EEPROM. ...
user avatar
0 votes
1 answer
2k views

I'm trying to build arduino nonce generator, but the only thing I found is this question on arduino forum but I can't find out how to make it work for me. I checked and Serial.available() is always 0 ...
krystof18's user avatar
  • 315
1 vote
1 answer
1k views

Pardon me, I am a novice programmer. I was trying to use the toInt() function for a std::string but I noticed that toInt() only works for the String class. So, I have an std::string sliderValue and ...
Enna's user avatar
  • 13
0 votes
1 answer
148 views

I am getting multiple messages from a GPS device at different frequencies. After getting strings I have to save this data on the SD card. It works well when we have the same frequencies messages but ...
Omar Rai's user avatar
-1 votes
2 answers
1k views

Well, I'm trying to use a HMI display and this HMI storing datas in separeta addreses. Such as integers addr. is between 0x80000 to 0x9ffff and also for string's addr is between 0 to 0x1ffff. At this ...
mehmet's user avatar
  • 297
1 vote
1 answer
2k views

I am trying use a HMI display. If I want to send a data, for example I want to write "TOPWAY" to 0x00000080 address it should like that: Serial.write(0xaa); // packet head Serial....
mehmet's user avatar
  • 297
0 votes
1 answer
2k views

In my Arduino project, a string will be received. I understand using .indexof to find the placement of a certain character in the string. My problem is that I need to find the first occurrence of any ...
dcal's user avatar
  • 1
1 vote
1 answer
399 views

I am trying to figure out how to capture the OK or the ERROR from a SIM800l. I have tried mySerial.println("AT"); while (mySerial.available() > 0 ) { String str = mySerial.readString(); ...
maxum's user avatar
  • 145
12 votes
6 answers
5k views

I've been reading a lot over the years why we should not use the notorious String class and how heap fragmentation is bad practice and not professional and we should never use it in our programs or we'...
Nino's user avatar
  • 411
1 vote
1 answer
7k views

I am compiling some code I didn't write, and it bombs out with the error message invalid conversion from 'char' to 'const char*' [-fpermissive] on the line if (loginPassword == '\0') loginPassword = &...
Ben Dauphinee's user avatar
1 vote
1 answer
631 views

I've read that the Arduino String is bad as it causes memory fragmentation, so I try to avoid them mostly. But I still have some occurences where I'm not quite sure if they are ok after all. The first ...
matthesinator's user avatar
1 vote
1 answer
3k views

Hello everyone I write my code and have some troubles. When I write on in my serial monitor my buzzer condition wasn't changed. Can you help me realize the reason. I wrote code with int type and it ...
Shushan Abovyan's user avatar
1 vote
1 answer
484 views

I suspect that I might be using too many resources, because of the strings, but I am new to Arduino, so not sure where I am going wrong. Any help would be appreciated. What it should do when complete:...
E_Ja's user avatar
  • 21
0 votes
2 answers
243 views

I use bluetooth (works like serial monitor). Let me say i send a text to my hc-05 (same as sending to serial monitor) My current code is displaying text from serial monitor/HC-05 TO LCD #include <...
redoc's user avatar
  • 119
0 votes
1 answer
739 views

I'm working on an ESP8266 module that needs to fetch date data from worldtimeapi, everything works fine but the problem is How do I strip of the time field off the datetime JSON response without loop. ...
Ruby's user avatar
  • 15
1 vote
0 answers
77 views

I am trying to keep the program within a loop until the user inputs "ok" on the Bluefruit Connect App. I use the readString() function on the bluetooth object (ble) to read from it. Before ...
Cem Adatepe's user avatar
0 votes
2 answers
7k views

Brief description about the problem History Communicating with a old VersaStat II used GPIB port but the GPIB ports PCI card stopped working but there was a another port 25 pin rs232 Serial ...
Avon97's user avatar
  • 161
1 vote
2 answers
1k views

I have following function for my Arduino: String readLine() { String received = ""; char ch; while (myFile.available()) { ch = myFile.read(); if (ch == '\n' or ch == '\r') { ...
sharkyenergy's user avatar
1 vote
2 answers
383 views

I have a Firmata sketch, that accepts string messages, partitions them and sends its' parts back to a Firmata client program. My problem is certainly at the sketch's side. The problem is that Firmata....
Starter's user avatar
  • 153
1 vote
1 answer
327 views

I have this callback function in my Firmata sketch. It receives a string as a character array and does something with it. The problem is, that the string is being sent to the Arduino in T\0h\0i\0s\0 ...
Starter's user avatar
  • 153
0 votes
1 answer
81 views

For the below code snippet const char* fr_fbdb(char tag[30]) // fn for retrieving data { char full_path[120]; const char *_dt ; strcpy(full_path , base_path); strcat(full_path , tag); ...
Somasundharam Sampath's user avatar
0 votes
0 answers
86 views

I've been working on a cipher based project, and I wanted to prep the encrypted string for use with the RF24 library. Since the payload size for the RF24 module is 32 bytes, I wanted to stick with ...
Okabe_'s user avatar
  • 17
3 votes
1 answer
6k views

I found this code sample from the FSBrowser (Flash File System) example in the ESP8266WebServer library: replyServerError(FPSTR(FS_INIT_ERROR)); replyBadRequest(F("DIR ARG MISSING")); I was ...
DV82XL's user avatar
  • 135
2 votes
1 answer
169 views

I am using the Arduino IDE to run and monitor, with an Arduino Nano clone. This code shows what I mean by the question: char foo = 127; char bar = 128; Serial.println(String(foo, BIN)); Serial.println(...
Boba0514's user avatar
-1 votes
1 answer
1k views

I have a mobile app (done using MIT App Inventor) storing some values to a Firebase database. App inventor stores all the values as strings (i.e. with quotes, and strings have quotes enclosed within ...
Somasundharam Sampath's user avatar
1 vote
0 answers
1k views

I am trying to create a class and getting getting the error incompatible types in assignment of 'const String' to 'char [32] when I declare char inString[32]; and try to set it as inString = server....
brad's user avatar
  • 201
1 vote
2 answers
3k views

I'm trying to compare a char array that I'm assembling to a string and I'm having trouble comparing the strings. I'm getting the data for the char array as a set of bytes and I'm compiling it into a ...
Chris Schmitz's user avatar

1
2 3 4 5
7