How to convert MAGA-3 Arduino integer code into Delphi Interfaces

const int AOUTpin=0;//the AOUT pin of the alcohol sensor goes into analog pin A0 of the arduino
const int DOUTpin=8;//the DOUT pin of the alcohol sensor goes into digital pin D8 of the arduino

int limit;
int value;

void setup() {
Serial.begin(9600);
pinMode(DOUTpin, INPUT);//sets the pin as an input to the arduino
}

void loop()
{
value= analogRead(AOUTpin);//reads the analaog value from the alcohol sensor’s AOUT pin
Serial.println(value);
if(value<200)
{
Serial.println(“Kamu Sadar”);
}
if (value>=200 && value<280)
{
Serial.println(“Alkohol Terdeteksi”);
}
if (value>=280 && value<350)
{
Serial.println(“lebih dari satu kamu minum”);
}
if (value>=350 && value <450)
{
Serial.println("Serius Kau Akan Mabuk ");
}
if(value>450)
{
Serial.println(“Kamu Peminum”);
}

delay (500);
}

So, what is it that you want help with ?
The thread title does not make sense to me.

There is no example of delphi programming using arduino mq-3 sensor … can not share the program just as an example of final task

frandofr:
There is no example of delphi programming using arduino mq-3 sensor

Do you expect to finds one in this Arduino forum ?

 if(value<200)
  {
      Serial.println("Kamu Sadar");
  }
  if (value>=200 && value<280)
  {
      Serial.println("Alkohol Terdeteksi");
  }
  if (value>=280 && value<350)
  {
      Serial.println("lebih dari satu kamu minum");
  }
  if (value>=350 && value <450)
  {
      Serial.println("Serius Kau Akan Mabuk ");
  }
  if(value>450)
  {
     Serial.println("Kamu Peminum");
  }

What an inefficient way to test ranges. Each test has to be performed even if a match is found! It is better to use “else if” so that fewer tests have to be made. It is also more foolproof when using floating point numbers.

  if (value < 200)
  {
    Serial.println("Kamu Sadar");
  }
  else if (value < 280)
  {
    Serial.println("Alkohol Terdeteksi");
  }
  else if (value < 350)
  {
    Serial.println("lebih dari satu kamu minum");
  }
  else if (value < 450)
  {
    Serial.println("Serius Kau Akan Mabuk ");
  }
  else
  {
    Serial.println("Kamu Peminum");
  }