Help Displaying Temp On Two 7-Pin LEDs

Hi :), I've recently been working on a project with a school arduino for a week now, I was wondering if I could get any help. I've been trying to get the temperature to display on 2 7-segment LEDs buy taking the readings off of a thermistor. Every thing is wired up correctly and I got the LEDs to display correct numbers, but I've been having an issue will it will read the temp, and stay stuck at 69, or 79, well any number always ending with a 9.
http://www.textswell.com/read,4206226243772
here's my coding, any help would be appreciated, also so would a correct temperature conversion.
Thanks

Not how you write an if statement:

if (temp = 60)

Correct way:

if (temp == 60)

Went back and switched them all to "==", but I still have an issue :/.
On the serial monitor, temp reads as 63-64, but no matter what, the two LEDs will only display 69.

You really really need to find out about arrays and look at examples of much simpler 7-segment LED drivers out there!

You probably still have "if (temp = 69)" in your code by the sound of it.

At the very least you should (re)factor the code to avoid all the dumb repetition, something like this as a framework would be a start:

void loop ()
{
  read () ;
  int high_digit = temp / 10 ;
  int low_digit = temp % 10 ;
  switch (high_digit)
  {
  case 0:  .... ; break ;
  case 1:  .... ; break ;
  case 2:  .... ; break ;
  ....
  case 9:  .... ; break ;
  }
  switch (low_digit)
  {
  case 0:  .... ; break ;
  case 1:  .... ; break ;
  case 2:  .... ; break ;
  ....
  case 9:  .... ; break ;
  }
  delay (10) ;   // allow time to pass to reduce LED flicker
}

But there's more to do to clean it up - and learn a lot in the process I think.

I looked over the code, all "=" are gone and it's only "==". I learned a bit on arrays in programming in java last year, most of which I totally forget, would you mind giving a brief/basic rundown on the code you posted?

Post your code as it is now, I'm sceptical about the = / == thing :wink:

I'll leave you to the learning process - find some other 7-segment driver code and read it - and find out how it all works, it will be a very useful exercise.

http://www.textswell.com/read,4206253715402
Unless I'm blind (very possible) There is no more "=" left lol

  void loop()
  {
    read();
    
    {
    if (temp >= 60 && temp < 70)
    
      if (temp == 60)
      {
        showLED6();
        showL0();
      }

See the problem?

Does the "(temp >= 60 && temp < 70)" have to be ">== 60" aswell?

Tried didn't compile, but I saw that there weren't braces after the (temp >= 60 && temp < 70) part, is that it?

jmi0920:
is that it?

You're the one with the hardware already hooked up and ready to test. Fix the issue and let us know.

If you give him the fish you will get Karma.
If you give him fishing lessons he will just get mad at you.
Isn't Karma great? They got rid of it once, I wonder how long it will take this time.

Don