Questions tagged [convert]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
2answers
73 views

Converting human readable date to a unix timestamp [duplicate]

Can anyone provide a sample code that would convert a human readable date like 2019-10-27 22:10:35 to a unix timestamp like 1572214235? I found many topics about it, but they eider refer to out of ...
0
votes
1answer
32 views

How to merge two GPS coordinates without losing decimals

I want to take the GPS coordinates like 42.1234 per 22.1234 and merge them as a string, with a separator character: 42.1234 x 22.1234 But using this code: gps_string = (String)gps.location.lat()+' ...
2
votes
2answers
70 views

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 ...
0
votes
2answers
194 views

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 *...
0
votes
2answers
80 views

Arduino analogRead fluctuates from sensor unless USB connected

I have an Arduino connected to a 4-20 mA sensor through a current to voltage converter. When connected to the power supply the sensor reading fluctuates, as soon as I also connect it to a USB port it ...
-1
votes
2answers
205 views

Adding byte to end of char [closed]

I have a function which is being passed a byte and I want to add the byte t the end of a character string and to pass to another function (from the MQTT library). This second function is looking for ...
1
vote
0answers
51 views

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 ...
0
votes
1answer
1k views

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 seperately? Here are more information to my Arduino project: The Arduino is ...
1
vote
1answer
44 views

Assign and control Digital pin from String

Here is modified version of Blink example #define D8 13 String p = "D8"; // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin ...
2
votes
2answers
3k views

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 ...
0
votes
1answer
134 views

Posting TinyGPS++ co-ordinates as paramaters with GPRS

I'm able to view my co-ords on the Serial Monitor using Serial.println(gps.location.lat(), 6); I believe the data type returned by gps.location.lat() is double. I need to pass this value to a ...
1
vote
2answers
314 views

Reconstruct uint32_t from char array to RTC.set

I am currently experimenting with a Digistump ATTiny85. Since it has no Serial, I use the basic DigiUSB library for communication. The RTC library used is this one: https://github.com/JChristensen/...
0
votes
2answers
94 views

3.3V from 5.0v outlet

I am working with an Adafruit Feather 32u4 FONA board. I want to connect a GPS module I have worked with before (3.3V required) but am not having much luck. I have studied the pinout of the board and ...
0
votes
1answer
3k views

How to make I2C work on RS485?

I'm trying to optimize the communication (minimize wires) on a project where I can control a motor and toggle some 230V devices by using RS485 and I2C. On this project, I'm using an Arduino (Mega) ...
2
votes
1answer
354 views

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 ...
1
vote
1answer
73 views

DS18B20 sending variable via Enthernet shield

I am trying to send temperature read from DS18B20 to a web server. I know two things: to read a temperature, and to send something to web server. What I don't know is how to convert float that ...
1
vote
2answers
127 views

3.3V Conversion [closed]

I'm writing a SPI Master module for my FPGA and I would like test it with my Arduino Uno. What's the problem? My FPGA has 3.3V logic and Arduino has 5V TTL logic. So, what's the simplest solution to ...
0
votes
2answers
691 views

Conversion between boolean and int went wrong

I have a small problem with conversion from bool array to int. It is working fine until it comes to the 12th cycle of while. I don't know why but this is really weird. I try to paste here a code ...
0
votes
3answers
2k views

How to use a coma as the decimal separator?

I have a LCD that displays a float variable. I would like to show a comma instead of a dot as the decimal separator. float temp = 23.50; lcd.setCursor(0, 0); lcd.print(temp); I want to show 23,50 ...
0
votes
1answer
2k views

String to unsigned long conversion

I'm trying to use strtoul() to convert an Arduino String to an unsigned long (like the return of millis();) using the following code snippet: unsigned long foo (String time) { unsigned long mili; ...
0
votes
1answer
185 views

Connecting Arduino to PC through Slimline SATA instead of USB?

I removed the DVD-RW from my laptop and want to use the new area as an IO port instead. There is an Arduino Nano with me which can fit into the emptied out drive space and there are some easy to ...
2
votes
1answer
552 views

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 "...
1
vote
2answers
2k views

Connect Arduino Uno RX/TX to 3.3v NEO-M8N gps module

I'd like to connect an M8N gps module to an Arduino Uno. From what I understand the Arduino pins 0-RX/1-TX work on 5V the M8N RX/TX work on 3.3v the sensor-TX sending to the Arduino-RX should work (...
0
votes
1answer
804 views

Converting array to char

I'm trying to convert a char array to a char. i used this code char code[4] = {'1','2','3','4'}; char strcode[4]; void setup() { Serial.begin(9600); } void loop() { memcpy(strcode, code, 4)...
-3
votes
1answer
54 views

Create an a message from two inputs[Programming Help] [closed]

I'm a bit new to this and I have the following function that I'm having trouble getting it to compile. The intent is to create a message to write out to a software serial port. Inputs are two int ...
0
votes
1answer
5k views

Hex String -> Byte Array -> Serial Write

I'm writing code that I discussed in a previous post. I now have a setup where I send my Arduino an ASCII-encoded Hex String that represents the bytes I want to write to my serial device. I think I've ...
-1
votes
2answers
2k views

ESP8266 - Parsing last char from a string

I'm trying to parse the last character from the string of the reply from server and print them to serial monitor. My arduino code: // This will send the request to the server client.print(String("...
2
votes
1answer
2k views

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 ...
0
votes
1answer
321 views

Convert ASCII output to human readable form and assign to a variable [duplicate]

I'm reading the RFID output and I can print it to the serial monitor as human readable. But what I want is to assign that to a variable. But I'm getting the ASCII. Is there any way to convert it and ...
0
votes
1answer
31 views

Should I use LLC to power sensors on grid pcb at 4mtr wire length distance?

I have setup a grid pcb that further distributes power and receive signal from sensors, I know low voltage can detroit if not damage sensors , so I am thinking to put BD-LLC to distribute power ...
0
votes
1answer
3k 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=?;
2
votes
2answers
1k views

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 ...
0
votes
3answers
1k views

A library for manipulate Intel Hex data?

For a project i need to extract some data from an external eeprom and then store it somewhere. Suddenly after some manipulations (not necessarly with Arduino board) i need to put them in an external ...
0
votes
1answer
7k 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
20k 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]...
4
votes
1answer
11k views

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?