How to write the program for my Pedometer

hi every one

I am doing a project on Pedometer step counting with date & time stamps

Aim: count the number of steps which will given by a pedometer in a 5 min of duration with Date & Time stamps and put it in a file

  1. DSPX01 Digital 3D pedometer [u]http://www.dorji.com/docs/data/DSPX01.pdf[/u]

  2. RTC 1307 real time clock for Date and Time stamps [u]http://datasheets.maximintegrated.com/en/ds/DS1307.pdf[/u]

3.microSD card for data logging & Arduino mega2560 board

I knew the basic step counting program ( if threshold exceed 670 at A0 port consider it's a step) I knew the RTC program I knew the SD card creating .csv files for data loging

I couldn't able to apply these things togather to work according to my app

CAN any one suggest me how to design an Algorithm and how to impliment it