Saturday, June 29, 2013

So I just realized I can add post titles

Wow, I didn't know that.

Anyways, today I went on searching for flex resistors. I can usually find a really nice deal on ebay, but this time I'm out of luck.
Sparkfun offers them for around $8, and other sites have the same price... more or less. Some sites sell them for $12.

Here is the thing: I need two of them.

As I have explained before, I am using them in a voltage divider to an analog pin on the Attiny.

If each sensor costs around $10, The price of this device might be a bit too high for High School coaches... maybe around $50.
Maybe I can make my own
There IS another option.

There are these piezo vibration sensors that are significantly cheaper, around $3. I have a few readily available. 
They are extremely sensitive to vibrations, and they generate voltage higher than what a microcontroller can read (up to 1023, after that, it's still 1023)

I am avoiding using these sensors, however there is a way to make them less sensitive...
On forums (and in experiment) I found that adding a bunch of resistors to the piezo sensor will not lower the voltage that much, however, maybe a capacitor might do the trick. I remember reading somewhere that adding a capacitor might stabilize the output.

I will try that.

Because these sensors are so sensitive, I might be able to just slap them flat onto the backboard and rim, instead of having them dangle from the side with a weight (see the setup illustrated in prior blog post)

I will keep you all updated.

*EDIT*

AHA!
So a problem was that the shot clock kept resetting to 24 after it went to 0.
This only occurs when you use the pause button, but if you do not use it, this glitch does not happen.
How I solved it?

It was a silly mistake on my part: I have no idea why I added it.

/***************countdown and analog reading****************/
void thedeal() {
  while (sec >= 0){
    countdown(sec);
    sec = sec - 1;
    
    for (int i = 0; i<575; i++){ //change this ~ seconds
      reading();
      compare();
      delay(1);
    }
  }
//sec = 24;  //mistake here!!//
}

No idea... What was I thinking.

Well, that is fixed. From here on, the problems I need to fix are pretty easy to fix! (this one was surprisingly easy to fix...)






Please ask questions in the comments.

This is the shot clock that will change the game.

No comments:

Post a Comment