Will you please post all of your code so that what you are doing can be seen in context of the data types and sensor reading techniques being used ? Details, a link maybe, of the 'photogate' that you are using and how things are wired would be helpful too.