SparkFun Forums 

Where electronics enthusiasts find answers.

General project discussion / help
Did you make a robotic coffee pot which implements HTCPCP and decafs unauthorized users? Show it off here!
By Chintan
#198895
I'm in a bit of a bind with something I'm working on. I wanted to try creating my own implementation of measuring the distance covered by a moving vehicle along highways and roads and that assigning fares for passengers based on the distance covered by each passenger. The route used by the vehicle is never fixed so use of maps wouldn't have helped. That meant I had to use GPS to calculate the distance.

I broke down the process to some steps but I haven't been able to combine them to a working program.

I'm using arduino by the way. These are the steps
  • Passenger enters the vehicle
  • Passengers swipes a card, NFC or RFID
  • Program registers the passengers card and assigns zero distance to that card
  • as the vehicle moves, the distance is calculated every second or every 2 seconds and the distance is added onto the value for that passenger
  • While the distance is being added, the program checks to see if the passenger is still there
  • If the passenger swipes their card the second time, it signifies they are alighting and the program should stopp adding the distance and return the accumulated total distance and fare calculated on that distance
  • The program should be able to do this for any number of passengers
I've modified some of the code for NFC found in the arduino examples so that it can check if someone has entered or alighted

I've also been able to get a working code to calculate distance every 1.5seconds and add that distance to a distance total

I however am unable to combine the above codes to create the larger program

How may I proceed for my project? My background is in electrical engineering but I don't have any coding experience - any guidance will be appreciated

Thank you

Chintan
By jremington
#198914
You will need to learn the programming language and gain coding experience. Start with something much simpler and work your way up.

If you have an Arduino, plenty of simple examples come with the free program development software.