LOGIN
Narendran Ashok
Engineer (Project Leader)
 · ChennaiIndia
Share
Get Link
Report
SHOW & TELL

String to inr conversion

so now i am going to send a string — on receiver end i will break it and then work as integer.

3 likes 
Like
Load 4 previous comments
Sai Prasad
Software Dev :) Let's build some dream ideas.
 · BhubaneswarIndia
Share
Get Link
Report

That hack of Jagannath Sahoo will work but do check for the characters range … if it is within 0-9 else you’d get unexpected values 🔧

1 like 
Abhi Verma
Electronics Engineer
 · DelhiIndia
Share
Get Link
Report

What about this?
String data = Serial.readString();
Int value= data.toInt();

No limits of size except the size limit of integer.

2 likes 
Sai Prasad
Software Dev :) Let's build some dream ideas.
 · BhubaneswarIndia
Share
Get Link
Report

Abhi Verma this will also work as long as the input is a character. As the function used is readString() you’d get a string returned … So before converting to Int the string has to be validated for character else there may be an issue again unexpected values I guess … Please do correct me if I’m wrong 😃

1 like 
Abhi Verma
Electronics Engineer
 · DelhiIndia
Share
Get Link
Report

Well narendran is going to send a string. So it’ll always be a string. 😃
Anyways i have written this code very long time ago. And also given to narendran. But he couldn’t use it due to his faulty nrf radio modules.
However code is working great on my modules. Watch this

3 likes 
Narendran Ashok
Engineer (Project Leader)
 · ChennaiIndia
Share
Get Link
Report

hey does nrf have different datasheets based on the manufacturers?

0 like 
Abhi Verma
Electronics Engineer
 · DelhiIndia
Share
Get Link
Report

Well these chips are made by nordic semiconductors. And they have two main versions, nrf24L01 and nrf24L01+.
Non plus module have air data speed of 2 mbps and 1 mbps.
Plus chips have data rate of 2 mbps, 1mbps and 250 kbps.
This is the only difference, otherwise chips are identically compatible with each other.

3 likes 
Leave a reply...
DISCOVER
CHAT
ALERTS
DISCUSSIONS
FEED