HELP?

Hello,

I'm building a project that's very similar to this --> http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads
(http://itp.nyu.edu/physcomp/Tutorials/HighCurrentLoads)
just like stated in this website. I'm doing this for a short project.

I did everything that was in that website and it work like a charmed. Now, i want to add an MAN72 led display or a led bar to represent the speed of the motor as i decrease or increase the output level of the potentionmeter, how can i make it work?

here my latest work:

Look at:-

Thanks you for your response,

Indeed i see how now but as for the code, can i add it to my recent program?

Example;

const int transistorPin = 9;

void setup() {

pinMode(transistorPin, OUTPUT);
}

void loop() {

int sensorValue = analogRead(A0);

int outputValue = map(sensorValue, 0, 1023, 0, 255);

analogWrite(transistorPin, outputValue);

const int analogPin = A0;
const int ledCount = 10;

int ledPins[] = {
2, 3, 4, 5, 6, 7,8,9,10,11 };

void setup() {

for (int thisLed = 0; thisLed < ledCount; thisLed++) {
pinMode(ledPins[thisLed], OUTPUT);
}
}

void loop() {

int sensorReading = analogRead(analogPin);

int ledLevel = map(sensorReading, 0, 1023, 0, ledCount);

for (int thisLed = 0; thisLed < ledCount; thisLed++) {

if (thisLed < ledLevel) {
digitalWrite(ledPins[thisLed], HIGH);
}

else {
digitalWrite(ledPins[thisLed], LOW);
}
}
}

Please point me to the right direction?

You can't have two "loop" functions, so you're going to have to merge the code.

Please point me to the right direction?

http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

AWOL:
You can't have two "loop" functions, so you're going to have to merge the code.

Thank you for your suggestion but perhaps you can write the code for me if its not too much t ask, if not its ok? I will go into "how to merge the code" in here but it might take a lot of time for me to follow? :frowning:

Grumpy_Mike:

Please point me to the right direction?

http://www.thebox.myzen.co.uk/Tutorial/Merging_Code.html

Thank you, i will see and try it out. Hopefully i will understand?