MQ2 Sensor to I2C OLED Problem Code

Hi guys, I have recently wanted to make a project where readings from my MQ2 Gas Sensor will be displayed in my I2C OLED. Do you guys have any sample code which I can use? If not, I have a code which needs editing, I can't seem to find the problem.

#include "U8glib.h"
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_NO_ACK);

bool first;
float gas = 0;
void gas_test(float*g);

*g = 0;
float g = readg();

void setup(void) {
  first = true;
    if (u8g.getMode() == U8G_MODE_R3G3B2)
  {
    u8g.setColorIndex(255);     // white
  }
  else if (u8g.getMode() == U8G_MODE_GRAY2BIT)
  {
    u8g.setColorIndex(3);         // max intensity
  }
  else if (u8g.getMode() == U8G_MODE_BW)
  {
    u8g.setColorIndex(1);         // pixel on
  }
  else if (u8g.getMode() == U8G_MODE_HICOLOR)
  {
    u8g.setHiColorByRGB(255, 255, 255);
  }
}

void GasSensor(float*g) {
  u8g.setFont(u8g_font_fub11);
  u8g.setFontRefHeightExtendedText();
  u8g.setDefaultForegroundColor();
  u8g.setFontPosTop();
  u8g.drawStr(4, 0, "Gas:");
  u8g.setPrintPos(80, 0);
  u8g.print(*g);
}

void loop(void) {
  GasSensor(&g);

  if (first)
  {
    first = false;
  }
  else
  {
    u8g.firstPage();

    do
    {
      GasSensor(&g);
    }
    while (u8g.nextPage());
  }
}


void GasSensor1(float g) {
  // Wait a few seconds between measurements.
  delay(1000);


  // Check if any reads failed and exit early (to try again).
  if (isnan(g))
  {
    Serial.println("Failed to read from Gas sensor!");
    return;
  }
}