user50053: I am trying to send MPU9250 sensor data to Pubnub IOT platform using node mcu, but not able to do it since the sensor data is not in JSON format. I know about publishing string but don't know about variable.
About Pubnub Library - https://github.com/pubnub/arduino
This is the part which I need help in:-
IMU.readSensor();

PubNonSubClient *pclient = PubNub.publish(pubchannel, IMU.getAccelX_mss());

But above line has error so how do i send imu sensor data to pubnub? All connections are right and sensor is working since I tested it.

user50053: This is the format which helped me to upload the data successfully. I didn't knew what JSON format was and got stuck. In case if someone stumbles on a similar problem. 
char buf[5] = {};

sprintf(buf, "\"%d\"", IMU.getAccelX_mss());

PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);


50053: <p>I am trying to send MPU9250 sensor data to Pubnub IOT platform using node mcu, but not able to do it since the sensor data is not in JSON format. I know about publishing string but don't know about variable.</p>

<p>About Pubnub Library - <a href="https://github.com/pubnub/arduino" rel="nofollow noreferrer">https://github.com/pubnub/arduino</a></p>

<p>This is the part which I need help in:-</p>

<pre><code>IMU.readSensor();

PubNonSubClient *pclient = PubNub.publish(pubchannel, IMU.getAccelX_mss());
</code></pre>

<p>But above line has error so how do i send imu sensor data to pubnub? All connections are right and sensor is working since I tested it.</p>
 50053: <p>This is the format which helped me to upload the data successfully. I didn't knew what JSON format was and got stuck. In case if someone stumbles on a similar problem. </p>

<pre><code>char buf[5] = {};

sprintf(buf, "\"%d\"", IMU.getAccelX_mss());

PubNonSubClient *pclient = PubNub.publish(pubchannel, buf);
</code></pre>
