How to send data from pin A0 to influxdb database

I can’t seem to figure out how to take my simple Arduino Sketch that monitors data on 1 analog pin and send that info to my influxdb database.

I’m using I believe influxdb version 1.8…

I found on the influxdb website give me example code to send info to the database I’m not sure where I need to add my existing code…

My Existing code:

#include "EmonLib.h"
// Include Emon Library
EnergyMonitor emon1;
// Create an instance
void setup()
{
  Serial.begin(9600);

  emon1.current(0, 111.1);             // Current: input pin, calibration.
}

void loop()
{
double Irms = emon1.calcIrms(1480);  // Calculate Irms only
Serial.print(Irms*230.0);           // Apparent power
  Serial.print(" ");
  Serial.println(Irms);             // Irms
}

Any help would be appreciated

Take a look at this blog post, seems to cover everything you’ll need

https://www.influxdata.com/blog/influxdb-c-client-library-for-capturing-statistics/