code for this feature

in my project me try to deduct total amount of customer via rfid card for example : the total amount in rfid card is 2000 , billing amount is 600 how to deduct these amount and remaining amount steady in my one fid card

plz advice me

balance -= billingAmount;
rfidCardWrite(balance);

saggy22:
what me do??......plz advice me

My advice would be to not double-post. Posting your question in just one part of the forums is adequate.

And......
You really should have read the How to use this forum - please read post at the top of the index page and How to use this forum before posting.

ie Your code and any error messages should always be placed between code tags. Posting it inline as you have done makes it much harder to read or copy and paste for diagnosis.

It's still not too late to edit your post and do this. You'll make potential helpers much happier. :slight_smile:

ok thanks now i understand and try to follow your instruction.

in that now me attach my file

saggy22:
ok thanks now i understand and try to follow your instruction.
in that now me attach my file

Thanks saggy22. And yes, if it’s too large to post (between code tags) it should be attached. :slight_smile:

#include<SoftwareSerial.h>
#include<LiquidCrystal.h>
SoftwareSerial mySerial(10, 11);
LiquidCrystal lcd (12, 13, 9, 8, 7, 6);
int count = 0;
int count1 = 0;
int count2 = 0;
int count3 = 0;
int check = 0;
int check3 = 0;
int check2 = 0;
char tag[] = "19004D30DBBF";
char tag2[] = "19004D31A9CC";
char tag3[] = "19004D204B3F";
char item[15];
int c = 0, b = 0, item1, item2, r = 0, a = 0, item3;
int total = 0;
char val;
int m1 = 2, m11 = 3, m2 = 4, m22 = 5;
int ir = A1;
int buzzer = A2;
void setup()
{
    mySerial.begin(9600);
    Serial.begin(9600);//serial monitor
    lcd.begin(16, 2);
    pinMode(m1, OUTPUT);
    pinMode(m2, OUTPUT);
    pinMode(m11, OUTPUT);
    pinMode(m22, OUTPUT);
    pinMode(ir, INPUT);
}

void loop()
{
    if (mySerial.available() && count < 12)
    {
        item[count] = mySerial.read();
        count++;
        delay(10);
    }
    if (count == 12)
    {
        //Serial.print(item);
        //lcd.print(item);
        Serial.flush();
        // Serial.println();
    }

    while (count1 < 12 && count == 12 )
    {
        if (item[count1] == tag[count1])
        {
            check++;
        }
        count1++;

    }
    while (count2 < 12 && count == 12 )
    {
        if (item[count2] == tag2[count2])
        {
            check2++;
        }
        count2++;
    }

    while (count3 < 12 && count == 12 )
    {
        if (item[count3] == tag3[count3])
        {
            check3++;
        }
        count3++;
    }
    {
        if (check == 12 && count1 == 12 )
        {
            item1 = 100;
            c++;
            if (c % 2 == 0)
            {
                total = total - item1;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                lcd.setCursor(0, 0);
                lcd.print("rice    =");
                Serial.print("rice    =");
                lcd.setCursor(11, 0);
                lcd.print(item1);
                Serial.println(item1);
                Serial.print("total=");
                Serial.println(total);
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
            else
            {
                total = total + item1;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                lcd.setCursor(0, 0);
                lcd.print("rice    =");
                Serial.print("rice    =");
                lcd.setCursor(11, 0);
                lcd.print(item1);
                Serial.println(item1);
                Serial.print("total=");
                Serial.println(total);
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
        }
        else if (check2 == 12 && count2 == 12 )
        {
            item2 = 200;
            b++;
            if (b % 2 == 0)
            {
                total = total - item2;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                lcd.setCursor(0, 0);
                lcd.print("biscuit =");
                Serial.print("biscuit =");
                lcd.setCursor(11, 0);
                lcd.print(item2);
                Serial.println(item2);
                Serial.print("total=");
                Serial.println(total);
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
            else
            {
                total = total + item2;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                Serial.println(total);
                lcd.setCursor(0, 0);
                lcd.print("biscuit =");
                lcd.setCursor(11, 0);
                lcd.print(item2);
                Serial.println(item2);
                Serial.print("total=");
                Serial.print("biscuit =");
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
        }
        else if (check3 == 12 && count3 == 12 )
        {
            item3 = 300;
            a++;
            if (a % 2 == 0)
            {
                total = total - item3;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                lcd.setCursor(0, 0);
                lcd.print("ghee    =");
                Serial.print("ghee=  ");
                lcd.setCursor(11, 0);
                lcd.print(item3);
                Serial.println(item3);
                Serial.print("total=");
                Serial.println(total);
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
            else
            {
                total = total + item3;
                lcd.setCursor(0, 1);
                lcd.print("Total=");
                lcd.setCursor(7, 1);
                lcd.print(total);
                lcd.setCursor(0, 0);
                lcd.print("ghee    =");
                Serial.print("ghee    =");
                lcd.setCursor(11, 0);
                lcd.print(item3);
                Serial.println(item3);
                Serial.print("total=");
                Serial.println(total);
                count1 = 0;
                count2 = 0;
                check2 = 0;
                count = 0;
                check = 0;
                check3 = 0;
                count3 = 0;
            }
        }
    }
    {
        if (Serial.available())
            val = Serial.read();
        if (val == '2')
        {
            digitalWrite(m1, HIGH);
            digitalWrite(m2, HIGH);
            digitalWrite(m11, LOW);
            digitalWrite(m22, LOW);
            //Serial.println("trolly forward");
        }
        else if ((val == '1') && (digitalRead(ir) == HIGH))
        {
            digitalWrite(m11, LOW);
            digitalWrite(m22, LOW);
            digitalWrite(m1, LOW);
            digitalWrite(m2, LOW);
            Serial.println("stop");
        }
        else if ((val == '1') && (digitalRead(ir) == LOW))
        {
            digitalWrite(m11, HIGH);
            digitalWrite(m22, HIGH);
            digitalWrite(m1, LOW);
            digitalWrite(m2, LOW);
            //Serial.println("trolly reverse");
        }
        else if (val == '3')
        {
            digitalWrite(m1, HIGH);
            digitalWrite(m22, LOW);
            digitalWrite(m11, LOW);
            digitalWrite(m2, LOW);
            //Serial.println("trolly right");
        }
        else if (val == '4')
        {
            digitalWrite(m2, HIGH);
            digitalWrite(m22, LOW);
            digitalWrite(m11, LOW);
            digitalWrite(m1, LOW);
            //Serial.println("trolly left");
        }
        else if (val == '5')
        {
            digitalWrite(m1, LOW);
            digitalWrite(m22, LOW);
            digitalWrite(m11, LOW);
            digitalWrite(m2, LOW);
            //Serial.println("trolly stop");
        }
        else
        {
            digitalWrite(m1, LOW);
            digitalWrite(m22, LOW);
            digitalWrite(m11, LOW);
            digitalWrite(m2, LOW);
            //Serial.println("trolly stop");
        }
    }
}

now support me how to solve my problem

beacuse in that ,add one more rfid card and its use for payment purpose

saggy22:
now support me how to solve my problem

I'm not your paid employee - don't tell me what to do.

It's late at night here, and I already wasted a lot of time cleaning up your code removing superfluous white spaces/blank lines so it could be posted.

There are still a few unnecessary brackets that should be removed, then it would be nice if you could add some comments to the code so that potential helpers know what's going on, and what some of the variables are for. Explain clearly which variables you refer to in your opening post, too.
Then maybe someone might want to help you further.

I can't see how your problem in your original post relates to the code you've posted

first sorry i did not say that sorry oldsteave

now me request u my point is : i have addd one more rfid card for payment purpose in that billing amount deduct and remaining amount steady in rfid card

I think Google translate is struggling here - I'm guessing that "remaining amount steady" means "balance"?

Your IP address indicates you're in India - we have an Indian section of the forum here

AWOL:
I think Google translate is struggling here - I'm guessing that "remaining amount steady" means "balance"?

Your IP address indicates you're in India - we have an Indian section of the forum here

I was just in the middle of saying much the same thing. I'm struggling to understand too.
Is it possible to move this thread to that section?

yes it means balance

In system there are three cards used. Those three cards are used for things and one extra card I want to use for payment purpose. In that card,billed amount should be detected and remaining amount should be displayed on LCD and MOBILE too.

i think now u able to understand my words and thanks for response thanks again