mostly working

This commit is contained in:
Jeff Clement 2016-02-11 19:18:19 -07:00
parent 2640265397
commit b23b07d133
2 changed files with 12 additions and 24 deletions

View File

@ -1,29 +1,16 @@
# README #
This README would normally document whatever steps are necessary to get your application up and running.
This is a quick Arduino project for a Kub Kar track timer
### What is this repository for? ###
### Wiring ###
* Quick summary
* Version
* [Learn Markdown](https://bitbucket.org/tutorials/markdowndemo)
* (D2 - SW - GND) Reset switch (held closed when car gate is up)
* (D3 - SW - GND) Car #1 sensor
* (D4 - SW - GND) Car #2 sensor
* (D5 - SW - GND) Car #3 sensor
* (D6 - SW - GND) Car #4 sensor
* (A4) SDA on LCD (YwRobot LCM1602 IIC V1)
* (A5) SDL on LCD
### How do I get set up? ###
* Summary of set up
* Configuration
* Dependencies
* Database configuration
* How to run tests
* Deployment instructions
### Contribution guidelines ###
* Writing tests
* Code review
* Other guidelines
### Who do I talk to? ###
* Repo owner or admin
* Other community or team contact

View File

@ -86,12 +86,13 @@ short state = 0;
void loop()
{
if (digitalRead(PIN_RESET) == LOW) {
if (state != STATE_READY) {
state = STATE_READY;
lcd.clear();
lcd.setCursor(0,0);
lcd.print("Ready?");
lcd.print("Ready...");
resetCars();
digitalWrite(LED_BUILTIN, LOW);
}
@ -109,7 +110,7 @@ void loop()
bool allDone = true;
for(short i = 0; i<CAR_COUNT; i++) {
if (cars[0].elapsedTime == 0) {
if (cars[i].elapsedTime == 0) {
if (digitalRead(cars[i].pin) == LOW) {
// car finished, record time
cars[i].elapsedTime = elapsedTime;