# How to convert numbers from Binary to Decimal? [Hijacked]

``````//receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

void setup()
{
while (!Serial);
Serial.begin(9600);

}

void loop()
{
{
char text[32] = {0};
char Amps[32] = {0};

Serial.print(text);
Serial.println(Amps);
}
}
``````

Moderator: This thread has two parts. Here is the other http://forum.arduino.cc/index.php?topic=539908.0

``````//transmitter_ASC basic

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(6,7); //CE, CSN pins RF24L01

const int analogIn = A0; //ASC758 connection
int mVperAmp = 20;  // scale factor
int ACSoffset = 2500; //see bi directional offset
int RawValue = 0;
double Voltage = 0;
double Amps = 0;

void setup()
{
Serial.begin(9600);

}

void loop()
{

Voltage =(RawValue/1023.0)*5000; //gets mV
Amps =((Voltage-ACSoffset)/mVperAmp);

const char text[] = "Amps1 ="; // writes Amps1= to Rx unit
radio.write(&text, sizeof(text)); //check ())- its correct
//delay(50);
const char Amps[8];

delay(3000);

}
``````

What do you understand by the programming concept of "scope"?

Look, cut out all the messing around with analogue inputs.

Simply assign a known value, like 3.14 to a float variable, send it and see what you receive.

What you are trying to do is not impossible (far from it), but your approach to basic problem-solving is not helping you.

All text send and receive is disabled.

float Coco=3.144 return gibberish
float Coco=6.244 return gibberish

Screen shots are attached

thanks

1Doc1.pdf (184 KB)

Are you trying for a prize or something?

POST YOUR CODE, BOTH RX AND TX, NOT SOME MASSIVE PICTURES

``````//receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

void setup()
{
while (!Serial);
Serial.begin(9600);

}

void loop()
{
{
//char text[32] = {0}; // for word Amps1=
char Amps[8];

//Serial.print(text);
Serial.println(Amps);
}
}
``````

Im able to send text but somehow I cant float a simple number accross. The radio.write(&…,sizeof(…)); does not compile without the ‘&’ if float is used.

`char Amps[8];`If you send a float, you should receive a float.

It seems I have to keep repeating this.

And the fact that I asked you to post both tx and Rx sketches.

Are you sure you really want help, or are you just trolling?

radio.write(&…,sizeof(…)); does not compile without the ‘&’ if float is used.

I don’t know what … represents, but if the compiler expects it, maybe that’s a clue for you.

``````//receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

float Coco;

void setup()
{
while (!Serial);
Serial.begin(9600);

}

void loop()
{
{
//char text[32] = {0}; // for word Amps1=
char Coco[8];

//Serial.print(text);
Serial.println(Coco);
}
}
``````

So, you’re send four bytes, and expecting to receive eight? (At least, I assume you’re sending four bytes, because, once again, you have omitted to post the transmitter code)

How’s that going for you?

``````//transmitter

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

RF24 radio(6,7); //CE, CSN pins RF24L01

void setup()
{
Serial.begin(9600);

}

float Amps = 3.142;

void loop()
{
Amps += 1.0;
delay(3000);
}
``````
``````//receiver

#include <SPI.h>
#include <nRF24L01.h>
#include <RF24.h>

void setup()
{
while (!Serial);
Serial.begin(9600);