Questions tagged [convert]

Change data from one format to another.

Filter by
Sorted by
Tagged with
1
vote
0answers
38 views

How to use 5v and 12v addressable led strip together

Hi guys I’m new to this forum and also not much experience about led lights question already asked but didn’t get any detailed answer I want to know can I provide working data signal to 2 different 5v ...
2
votes
1answer
36 views

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

How to use float data from a sensor with the Arduino mouse library

I'm using a gyroscope, which returns angular velocity in floats. I'm trying to use this data with the arduino mouse library. The move function requires a signed character. I'm not what the best way is ...
6
votes
2answers
14k 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?
-1
votes
2answers
54 views

Convert string to integer

I'm using two ESp32 in a server and client configuration and i'm sending data between them in form of strings but i want to convert the recieved data which is fom of strings but it contains numbers ...
0
votes
2answers
79 views

Float to int conversion not working right in method using varargs

I am trying to convert a floating point number to an integer, but it seems like the conversion is not working properly. I am using the math library to calculate the power of 10 based on the number of ...
2
votes
1answer
116 views

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

Convert character to Integer while leaving encoded

I have two characters, that I get by Bluetooth. char a = SerialBT.read(); char b = SerialBT.read(); According to the Arduino Reference, decoded data stored in a char gets encoded to ASCII text. I ...
3
votes
4answers
6k 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 *...
3
votes
2answers
11k 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
0answers
60 views

Tapered log potentiometer to linear formula

I have a tapered log 10K potentiometer. I would like some function which returns tapered log value to linear values. The potentiometer is a slider. When connected to the Arduino the wiper displays the ...
-1
votes
2answers
185 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
vote
0answers
37 views

RFID RC522 Serial Communication converting problem

I am new to the RFID Scene and Serial communication as well. So I am trying to use the RC522 RFID module and I wrote in block 22 - 0x36 which is 6. I want to write a code where I take whatever is in ...
-1
votes
1answer
300 views

Reading bmp images from SD card, converting it and displaying it on serial monitor in Arduino

Can someone please help me write code that can read a 24-bit BMP file from an SD card, save converted to 8-bit BMP internally, and display the 8-bit BMP pixel values on Arduino terminal as a 2D matrix....
1
vote
1answer
134 views

How to split a *char and pass to a function needing uint8_t?

I have a requirement where an event has char *newvalue. void event(char *newValue) { //Code here } newValue is 2 digits. If it's 1-9 it is " 1" " 2" and 10+ is "10" "11" etc. It also can contain ...
1
vote
1answer
857 views

cast double to long leads to unexpected results

I wrote a little program to show my problem: void setup() { Serial.begin(9600); double K=39.85; double a=K*100; Serial.print("a= "); Serial.println(a); long val_long = 0; val_long = ...
1
vote
0answers
67 views

Converting string to byte array and byte array to string?

I am trying to create a string message and then encrypt it via AES but the example only accepts byte array as input. How can I convert fullmessage string to message byte array to encrypt it? Checked ...
1
vote
0answers
70 views

8266 get uint8_t PROGMEM array from uploaded file

I'm new programming arduino. I have connected an Adafruit thermal printer to an ESP8266 board. I've the example code for use the board like a webserver that allow upload files. What i want is to ...
0
votes
1answer
50 views

Need function to convert bool array to int- why doesnt this work?

Hey I wrote this function to convert an bool array to int: (Math Lob included): bool b_array[5]; int convertToInt(start_index,stop_index){ int run=0; int result=0; for(int id=start_index;...
1
vote
2answers
2k 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
77 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
347 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 ...
2
votes
0answers
66 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 ...
-1
votes
2answers
1k 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 ...
0
votes
1answer
8k 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
248 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 ...
0
votes
2answers
140 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
205 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
793 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/...
1
vote
1answer
8k 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
661 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
136 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
140 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 ...
1
vote
2answers
1k 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 ...
1
vote
3answers
5k 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 ...
-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("...
0
votes
1answer
5k 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; ...
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 (...
2
votes
1answer
3k 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
281 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
969 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 "...
0
votes
1answer
1k 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
61 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
6k 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 ...
0
votes
3answers
2k 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
515 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
36 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
4k 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
2k 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
1answer
9k 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[] =...