Questions tagged [convert]

Change data from one format to another.

Change data from one format to another.

58 questions
7
votes
2 answers

How to convert string to long?

There is String.toInt(), but no String.toLong() or the many other variations. Do I have to resort to atol(String.c_str()) or is there a better way to convert a String to a long?
Ana
  • 480
  • 3
  • 7
  • 13
5
votes
4 answers

Convert String to IPAddress

How can i convert a String to IPAddress on arduino / esp ? etc. "192.168.1.2" -> IPAddress(192, 168, 1, 2) Tried this void setup() { Serial.begin(115200); IPAddress apip; const char *apipch; apipch =…
strange_esp
  • 59
  • 1
  • 1
  • 3
4
votes
2 answers

How to converte EPOCH time into time and date on Arduino?

I have a question on how to convert EPOCH timestamps, which I receive as char*, into DD.MM.YYYY and HH:MM:SS format separately? Here is more information on my Arduino project: The Arduino is receiving through an ESP8266 module three different EPOCH…
imax10000
  • 43
  • 1
  • 1
  • 3
3
votes
1 answer

How do I use a transmitter and receiver to send string messages conditionally to a receiver?

I'm working on a project to build a plant monitor that works from the outside with Arduino that picks up light and water values from it's environment then uses a nRF24L01 with an antenna and I've come across a roadblock in the code with using a…
3
votes
1 answer

Programmatically-adjustable buck converter module?

LM2596 is easy to use and cheap, but I have to adjust the output voltage using a screw driver. On the web, there was a "hack" that someone posted, but that hack does not seem as clean or stable as using LM2596 as it is intended to be used, using…
Damn Vegetables
  • 357
  • 1
  • 3
  • 9
3
votes
2 answers

Problems on convert byte[] to String

I'm reading a RFID Card from RC522 and send the data to my computer. My problem is the conversion of byte[] to String or std::string. #define SIZE_BUFFER 18 #define MAX_SIZE_BLOCK 16 byte buffer[SIZE_BUFFER] = {0}; byte tam = SIZE_BUFFER; //…
Augusto
  • 131
  • 1
  • 1
  • 5
2
votes
1 answer

Converting from Float to Int yielding weird results. What am I doing wrong?

So I am trying to take GPS data with a Neo 6M gpsmodule (that is what is covered up by the square for privacy sake) and process it by adding/multiplying to get large integers representing the GPS data. This is using Arduino nano. When I try and…
2
votes
2 answers

How to convert char[12] to byte[6]

I am trying to convert a char[12] array that contains a Mac Address into a byte[6] in order to use within the Ethernet.begin method. I have tried various methods from online, but had little success to date. The char array currently contains…
BelGaraath
  • 33
  • 4
2
votes
0 answers

Converting Client input char to int

I'm trying to print out the temperature from a DS18B20 sensor to my app via a tpc connection. Because I have two sensors connected I will need to call the one needed by an Index. This index comes from my app and is a char value which I need to…
Janik
  • 41
  • 2
  • 9
2
votes
1 answer

Arduino String: use a non-null-terminated char array?

I'm using a library that takes a String as it's parameter (https://github.com/gmag11/painlessMesh) I want to pass char arrays that is binary (UTF-8) data that also contains null-bytes (0x00). Right now, the resulting String is cut off at the first…
user125756
  • 123
  • 3
2
votes
1 answer

How to understand the "power economy" of a voltage up-converter (boost converter)?

My online video Arduino instructor makes use of various devices to amplify signals, currents, and voltages. This seems like magic to me. For instance, he has 4 AA batteries with 1.2V each. He says "that's not going to be enough for Arduino" so he…
Hack-R
  • 139
  • 9
2
votes
1 answer

Convert LIRC config file to Arduino IR remote command

I have a LED 24 button remote with a few broken buttons and I want to simulate all the buttons with an esp8266 using an IR remote library. I would like to know if someone can help me translate the LIRC config file with all the functional buttons to…
nemo9955
  • 21
  • 1
  • 3
2
votes
2 answers

Arduino Pro mini to CH340G Connection problem

I have worked with Arduino UNO but recently I bought a new Arduino Pro mini 5v 16M and a CH340G converter to work with. I have searched google to connect pins but I found examples that explains this way : GND to GND VCC to VCC Converter RDX to…
Eldar Zeynalov
  • 125
  • 1
  • 5
1
vote
1 answer

Parse char* mac-string to uint8_t array

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-address "B8C9A45BA770" <- (just an example). I need…
1
vote
1 answer

float miscalculation when int32_t variable is divided by 10

i want to ask, how to get correct float value from uint32_t or long variable is devided by 10?? long var3 = 1139399025; int a = 3; int b = 10; void setup() { Serial.begin(9600); Serial.println((float)a/b,2); …
mukhlas
  • 11
  • 2
1
2 3 4