ATTiny85 w/ DrAzzy's Core - LDR analogRead problem

Hello everyone, I am trying to make a dark detector of sorts and am having some trouble with the final steps of getting a reading from an LDR on pin 3 of an ATTiny85. I am using DrAzzy's ATTiny core because of a piezo I have attached to the device and the fact that his core was practically the only core I could find that supports the Tone() function.

As of right now, I am in the process of developing the final code, but basically have a program that will react in one of two ways. One reaction being the piezo beeping at a high(er) tone and an LED flashing for a short amount of time before turning off for a much longer amount of time. The second reaction, is just the opposite of the first essentially. The piezo would sound at a lower tone and the LED would stay lit for a considerably longer amount of time more frequently.

My goal in having these two if/else loops stages was to determine if the LDR I have hooked up to pin 3 on the ATTiny is functioning and providing a reading (as which stage/loop/reaction used depends on the LDR reading variable - see code below). However, it seems that no matter how much I cover up the LDR or put it under light, the loop stays in the first high tone low frequency LED phase. I am assuming this means that either the analogRead function is not working (as I have seen may be the problem according to several other topics), there is a wiring problem, or some other 'fixable' error.

I have included my code below for reference.

Thank you and any help with the issue would be greatly appreciated,

E-Lectro

int val = 3;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
    pinMode(0, OUTPUT);
    pinMode(1, OUTPUT);
    pinMode(3, INPUT);
    
}


void loop()

{
 val = analogRead(3);

 if(val > 200)

 {
  digitalWrite(0, HIGH);
  tone(1, 1000);
  delay(100);                       
  digitalWrite(0, LOW);
  noTone();
  delay(2500);
 }

 else

 { 
  digitalWrite(0, LOW);    
  tone(1, 500);
  delay(1000);                       
  digitalWrite(0, HIGH);
  delay(250);
}

}

That really ought to work. Measure the voltage on the analog pin (could there be a bad connection to the high side of the LDR, ie on one side of the resistor, so it's just connected to ground?). Doublecheck the pinout .

Pin4 works better for tone output (per doc I linked above), but at that frequency, any pin should work.

You realize that it's only checking the LDR every 2.6 seconds if playing the short high pitch tone, right? So if you're not covering it up for long, that could be the issue.

Tested with this (very slightly) modified version (changes are just to make it easier to see on the scope. It works fine (using a pot in place of the LDR), so I conclude that you have a wiring problem as I suggested above.

int val = 3;

void setup() {
  // initialize digital pin LED_BUILTIN as an output.
    pinMode(0, OUTPUT);
    pinMode(1, OUTPUT);
    pinMode(3, INPUT);
    
}


void loop()

{
 val = analogRead(3);

 if(val > 200)

 {
  digitalWrite(0, HIGH);
  tone(1, 1000);
  delay(1000);                       
  digitalWrite(0, LOW);
  noTone();
  delay(250);
 }

 else

 { 
  digitalWrite(0, LOW);    
  tone(1, 500);
  delay(1000);                       
  digitalWrite(0, HIGH);
  noTone();
  delay(250);
}

}