Arduino for two loops

Dear All

I am making a project for my department where i need to make a counter and post its data to anywhere on the internet here is a little scenario i have done

  1. I use laser light and photocell, if any object cut the laser light the counter + it self. (succeeded)
  2. Use the Google spreadsheet and Pushingbox to push the data to internet without hessel. it is totally a different program. I took an example from this video
    Arduino Data Logging to Google Docs (Spreadsheet) - YouTube
  3. Now what I want is to put the two programs together, and compile it. the problem i am facing is that now there are two loops and it take forever two update since one loop has a time frame of 1minute. my counter is updating continously but one by one. i am attaching my code . most of it i got from internet. any help will be so much appriciated.

arduinosensor.txt (4.19 KB)

my counter is updating continuously but one by one

You are incrementing ctr when sensA [u]is[/u] below the threshold. Should you rather be incrementing it when sensA [u]becomes[/u] less than the threshold ? This would avoid multiple counting of the same object.

  else
  {
    ctr = ctr;
  }

Not needed

it take forever two update since one loop has a time frame of 1minute.

So, reduce the value of postingInterval