<Need Help> Soft I2c + DS1307RTC module + Led coding

Hi everyone. Sorry if my content not realated to this topic but im new in arduino ( just begin last month ).

I have to doing small project to control aquarium lighting by attiny85 with RTC DS1307 module (reference to https://forum.arduino.cc/index.php?topic=219680.0) . But my fault, im used pin PB2 ( physical pin 7) of A85 to potentiometer (SCL pin ) so i must use SoftI2c and so on must use soft DS1307RTC lib. i got problem that i cant sure A85 get time from RTC or not. All im done just dimming led, not timeset, not alarm.

My setup pin :

NC – 1 8 — VCC (5v)
SDA – 2 7 — potentiometer
SCL – 3 6 — LED output ( using current mirror Fet control)
GND – 4 5 — NC

Lirary im using :

SoftI2c : https://github.com/TrippyLighting/SoftI2cMaster
SoftDS1307RTC :https://github.com/kamermans/SoftDS1307RTC

My code:

#include <TimeLib.h>
#include <SoftI2cMaster.h>
#include <TwoWireBase.h>
#include <SoftDS1307RTC.h>

#define SCL_PIN 4
#define SDA_PIN 3

#define POINT 10

//led and pot 
byte led = 1;
int val;
int oldval = 0 ;
int diff;

//timing
byte stage = 0;
int lightSetpoint = 0;
byte rampTime = 30;
int oldRamptime = 0;
int maxBrightness = 255;



int moon = 30;
int noon = 170;

int On = 6;
int Mid = 12;
int Noon = 13;
int Moon = 23;
int Off = 17;






/////////////////////////////////////
void setup() {
  Serial.begin(9600);
  setSyncProvider(RTC.get);
  pinMode(led, OUTPUT);
  TCCR0A |= (1 << COM0B1);
  TCCR0A |= (1 << WGM01) | (1 << WGM00);
  TCCR0B |= (1 << CS00);
  
  rampTime = rampTime * 60000 / maxBrightness;
  /////////////////////////////////////////




  //////

}

void loop() {
  val = analogRead(A1);
  val =map(val,0,1023,0,255);
  
  if (val-oldval > POINT){
    oldval = val;
    
    analogWrite(led,val);
  }
  RTCset();
}
  
  
  ///

void RTCset(){
  int currentTime = millis();

//

  //
  if (stage == 0 && (hour() == On)) stage = 1;
  // Stage 1. Sunrise Code.
  if (stage == 1 && currentTime - oldRamptime > rampTime) {
    oldRamptime = currentTime;
    lightSetpoint++;
    if (lightSetpoint == maxBrightness) stage = 2;
  }
  //
  if (stage == 1 && (hour() == Mid)) stage = 2;
  // Stage 2. Noon Code.
  if (stage == 2 && currentTime - oldRamptime > rampTime) {
    oldRamptime = currentTime;
    lightSetpoint--;
    if (lightSetpoint == noon) stage = 3;
  }

  //
  if (stage == 2 && (hour() == Noon) ) stage = 3;
  // Stage 3. Sunset Code.
  if (stage == 3 && currentTime - oldRamptime > rampTime) {
    oldRamptime = currentTime;
    lightSetpoint++;
    if (lightSetpoint == maxBrightness) stage = 4;
  }

  //
  if (stage == 3 && (hour() == Off) ) stage = 4;
  //
  if (stage == 4 && currentTime - oldRamptime > rampTime) {
    oldRamptime = currentTime;
    lightSetpoint--;
    if (lightSetpoint == moon) stage = 5;
  }

  //
  if (stage == 4 && (hour() == Moon)) stage = 5;
  //
  if (stage == 5 && currentTime - oldRamptime > rampTime) {
    oldRamptime = currentTime;
    lightSetpoint--;
    if (lightSetpoint == 0) stage = 0;
  }

  if (stage != 0) {
    if (val < lightSetpoint) {
      for (val; val <= lightSetpoint; val++) {
        analogWrite(led, val);
        
      }
    }
    if (val > lightSetpoint) {
      for (val; val >= lightSetpoint; val--) {
        analogWrite(led, val);
        
  }
    }
      }
      
}

Personally I would rewire. If this is on a real PCB, this will imply cutting tracks.

Note that I have no experience with ATtiny.

@nhannguyen310, do not cross-post. Other thread removed.

Thank Sir very much. Just cause i really dont know which one is fit to my case

sterretje:
Personally I would rewire. If this is on a real PCB, this will imply cutting tracks.

Note that I have no experience with ATtiny.

Yes, re-design is the easiest way to do. But in my case, just can not. So im must looking for another way to make it right.

Anyone please help me.

There's no one did it before ??? :(((((