We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i urgently need a speaker simulator program for the project. i try searching my intrnet but cannot find much that is good. please someone must have some like anyone have library or source code for it?
How is the LED connected to the controller?
If it's connected to a port pin, then you just set that port pin to the appropriate level (1 or 0) required by your hardware.
If it's connected to a port pin, then you just set that port pin to the appropriate level (1 or 0) required by your hardware. with many derivatives, setting the port pin to '1' will not make the LED light up unless external measures are taken. Small LEDs (and their series resistor) directly driven by port pins should be connected between Vcc and the port pin.
Erik
I meant my answer to be a bit more generic than it now looks.
:-(
The truth of the matter is that the question is impossible to answer without proper details of how the LED is connected.
As the OP didn't even think to mention this detail, it is not surprising that he can't get it to work!
I just took a look at the whole thread and there is not one single detail from the OP.
I guess he is trying to make us curious and his next post will be "I sell crystal balls"
i put on the led to the port pin and it lit bright but then wend down but i didnot change your code.
i go again and led is not bright but same code ?)
i didnot change your code. whose code? what code? post (a link to) it.
i go again and led is not bright but same code ? what do you mean by "go again"? power down/power up? reset? loop?
more words do not make you appear stupid, they make you appear clear
"i put on the led to the port pin"
What does that mean?!
Trying to describe electronic circuits in words is a really Bad Idea. Upload a schematic (circuit diagram) to somewhere accessible, and post a link to it.
"it lit bright but then wend down"
Again, what does "wend down" mean??
Did you use a series resistor, or other current-limiting device? If not, it could well be that it "lit bright" until the LED and/or the port driver blew up - so it will obviously never work again!
yes it is not your code it is mine
i start the code again and the led is not bright but it was before
A LED that is connected directly to a processor pin without a series resistor is likely to light up very bright, but for a limited time.
Very few LED are suitable for direct connection to 3.3V and the problem is evern worse if you have a processor with 5V output logic.
you told me too put led to the port pin
what is series resestor? i look in help for compiler but can not find
"what is series resestor?"
Oh dear!
This is basic electronics. You need to put the software aside for a while, and learn about basic electronics. Or stick to a purely software-only project.
" i look in help for compiler but can not find"
Of course you can't: it's part of your target hardware - it has nothing whatsoever to do with the compiler.
I looked in manual for car and couldn't find how to clean bath tub. What did I do wrong?
How much time have you spent with Google? Have you tried to google for information about how to use a LED? Have you tried to google for LED and resistor? Have you googled for series resistor? Have you googled for LED and FAQ? Have you noted that a number of places that sells LEDs also sells resistors? Are you activelly looking for information, or do you think it is better to invite someone to get to your house and do all jobs for you? This alternative may be easier, but such people want to get payed!
Connect a LED to a pin does not mean that there are one - and only one - way to connect it. The LED has two pins. One pin _may_ be connected directly to a processor pin, potentially with a series resistor in between. The other pin _may_ be connected to VCC or to GND, potentially with a series resistor in between. The resistance of that series resistor depends on the output-high voltage of the processor pin OR the VCC value. And it depends on the voltage the specific LED requires. And it depends on how many mA you want to feed to the LED. Different LED requires different amount of current (mA) to light. Some are more efficient. Some are less efficient. Some support very high currents. Some support a very limited current. The world is full of variables. They must all be taken care of to get a final solution. You have not posted a single fact - so not a single variable has been given a known value. Hence, there is not anyone on this list who can help you. The big problem here is that you seem incapable of helping yourself too. You seem to make random assumptions, instead of starting with facts and build from a known base.
You said you spoke to a lecturer about this.
Clearly, the lecturer assumed that you understood these things.
As Erik observed earlier, either this 'lecturer' is asking you to do things he has not covered (which is unreasonable), or you have not been applying yourself to your course...
"you told me too put led to the port pin"
Nobody on this forum told you to "put led to the port pin"
You said the LED was suggested by a lecturer - didn't he say how to connect it? If you didn't know, why didn't you ask him?
i think i go back and make sound bcoz i think it is eesier
you told me to set that port pin to the appropreate level so i did and now you said i am not right
now it does not work
i tell my lecterer you make mistake and not me!