Getting RFID data from sensor and sending HTTP post

Hello ,

I have question how can i run two tasks on arduino example i need to always read from rfid if card is detected , but also need to send http post to server every example 40 sec . So i made something but i have problem so when http is sending ( it need about 11 sec to send - if you have faster way to send http just tell ) , i cant read tag i need to wait to finish http posting then i can read rfid , rfid is connected to arduino mega serial3 so if i can do some interrupt on come or something… . RFID module is pn532 , i use sim808 module and arduino mega.

You need to write state machine based code which doesn’t hang up in one state. It should not have any infinite or long loops. Event driven code is what you need.
There is no way to speed up HTTP. 11 sec is quite good on a 2G module.
If you use interrupts, you can write code inside ISR to read and store RFID data without processor leaving the main HTTP posting task.

Yes but when it goes to event to send HTTP it hangs to it around 11sec , and i cant call any other event such as red rfid , i tried interuupts but pn532 doesnt have such option…