Arduino Clock with LDR . PWM intensity control question

Thread Starter

chrischrischris

Joined Feb 18, 2012
313
Hi, can someone please help me with some code for an Arduino circuit.
I've written a program to run a mm:ss timer with pause/start and reset. I've multiplexed the 4 x 7 segment displays. I've also created another circuit to test controlling the intensity of a single LED via an LDR. I'm now trying to merge the 2 but having difficulty.

Below is a part example of the code where I tried to change it, but it isn't working:

digitalWrite(commons [0],HIGH);
previousMillis=currentMillis;
sevenSegWrite_1(sec_ones);
digitalWrite(commons [3],LOW);
with
analogWrite(commons [0],value);
previousMillis=currentMillis;
sevenSegWrite_1(sec_ones);
analogWrite(commons [3],value);

(Please find the whole file attached - renamed to .txt from .ino as I didn't know how else to upload it)
 

Attachments

Top