whenever, my LDR gives the output, it will be changing according to the brightness....accordingly, the comparison output will change..right??? this changing voltage should be sent to LED everytime using serial port. So for sending this changing voltage i need to write a code...so thats what i am saying...hope u r getting me???
whenever, my LDR gives the output, it will be changing according to the brightness....accordingly, the comparison output will change..right??? this changing voltage should be sent to LED everytime using serial port. So for sending this changing voltage i need to write a code...so thats what i am saying...hope u r getting me???
if you dnt mind can i have a look at it???
also i got this code from the web which can help me somethng do you wanna see if its the write thing...in this i will be connecting TxD to my LED circuit..and controlling RTS....
if you dnt mind can i have a look at it???
also i got this code from the web which can help me somethng do you wanna see if its the write thing...in this i will be connecting TxD to my LED circuit..and controlling RTS....
hi,
Read your link, it deals with DTR and RTS for remote UART sensing.
Whats the format of the serial data that you are sending to the remote PC.?
Note: if the remote PC's program expects the DTR and other control signals for its serial port, its possible to link pins on the DB9 which will supply the the required signals.
This maybe required as you are using the control signals for LED's.
hi,
Read your link, it deals with DTR and RTS for remote UART sensing.
Whats the format of the serial data that you are sending to the remote PC.?
Note: if the remote PC's program expects the DTR and other control signals for its serial port, its possible to link pins on the DB9 which will supply the the required signals.
This maybe required as you are using the control signals for LED's.
************************************
i am not sure if i am answering the right thing to you....
MY PC is sending the voltage to the LEDs using Serial port so it will be in digital format....i.e. integer right?? and i thnk this code only uses RTS pin....
What if in place of char Hello world i just send the voltage value to the port...u think it will work??? and then i can put it into a loop to keep doing it...???
************************************
i am not sure if i am answering the right thing to you....
MY PC is sending the voltage to the LEDs using Serial port so it will be in digital format....i.e. integer right?? and i thnk this code only uses RTS pin....
What if in place of char Hello world i just send the voltage value to the port...u think it will work??? and then i can put it into a loop to keep doing it...???
Not really.!
You are sending pulses to the DTR line which drives the LED drive transistor.
Not data.
The pulses are in a PWM format, pulse width modulation.
example: set DTR high, led is lit, set DTR low, led is off.
If you send an On and Off pulse at a fast rate and the On and Off periods are of the same duration, the led will appear at roughly half brightness.
If you make the On period say 75% and the Off period 25% then the led will appear at roughly 75% brightness.
As you know the required brightness of the LED after calculating from the LDR input from the PC paraport, you can pulse the DTR at the required mark/space ratio.
Not really.!
You are sending pulses to the DTR line which drives the LED drive transistor.
Not data.
The pulses are in a PWM format, pulse width modulation.
example: set DTR high, led is lit, set DTR low, led is off.
If you send an On and Off pulse at a fast rate and the On and Off periods are of the same duration, the led will appear at roughly half brightness.
If you make the On period say 75% and the Off period 25% then the led will appear at roughly 75% brightness.
As you know the required brightness of the LED after calculating from the LDR input from the PC paraport, you can pulse the DTR at the required mark/space ratio.
you know what...this logic i am trying to explain my supervisor since morning...but he is not understanding...he says send dat...but how can i send data with using DAC or something.....He wants PWM controlled circuit with data... ,....
but yes what you are saying is write...the ratio i can decide by my output...the problem is m trying all this but not getting through
but yes have to do it so will keep trying for another week....as it is due next week.
you know what...this logic i am trying to explain my supervisor since morning...but he is not understanding...he says send dat...but how can i send data with using DAC or something.....He wants PWM controlled circuit with data... ,....
but yes what you are saying is write...the ratio i can decide by my output...the problem is m trying all this but not getting through
but yes have to do it so will keep trying for another week....as it is due next week.
ldr1 is my input circuit and the other circuit is the one you have given me...he says, replace the DTR pin with Txd and set the RTS pin low or high and make it working...
my input is ready, getting all the voltages properly and storing them in a variable. now point is the output...
he expects to set the RTS pin high and low using the code and while doing this write the data on serial port.....but whats the use of writing like should i write the voltage value on the TxD line will will be given to the driver circuit??? but i dnt thnk this works...
ldr1 is my input circuit and the other circuit is the one you have given me...he says, replace the DTR pin with Txd and set the RTS pin low or high and make it working...
my input is ready, getting all the voltages properly and storing them in a variable. now point is the output...
he expects to set the RTS pin high and low using the code and while doing this write the data on serial port.....but whats the use of writing like should i write the voltage value on the TxD line will will be given to the driver circuit??? but i dnt thnk this works...
You can use either the DTR or RTS signal to drive the transistor.
If you send a 'voltage' value on the TXD line it will be in RS232 format and will not be suitable for controlling the brightness of the LED.
It will only be useful if you have a remote PC or UART that can receive the RS232 data.
I think there is a misunderstanding between you and the teacher of what is required.
Ask him why does he want you to switch the RTS line and whats the purpose of putting the LDR voltage on the TXD line.???
You can use either the DTR or RTS signal to drive the transistor.
If you send a 'voltage' value on the TXD line it will be in RS232 format and will not be suitable for controlling the brightness of the LED.
It will only be useful if you have a remote PC or UART that can receive the RS232 data.
I think there is a misunderstanding between you and the teacher of what is required.
Ask him why does he want you to switch the RTS line and whats the purpose of putting the LDR voltage on the TXD line.???
i tried to toggle the DTR line finaaly using a code....but if i connect just a LED and resisitor it is working but it is not able to drive the circuit that you suggested me
i tried to toggle the DTR line finaaly using a code....but if i connect just a LED and resisitor it is working but it is not able to drive the circuit that you suggested me
like when i set the DTR pin i get voltage -11V and when i clear it i get +10.6V. And once, the code stops, the output at DTR is again -11V. So is everything going ok according to your kowledge?
like when i set the DTR pin i get voltage -11V and when i clear it i get +10.6V. And once, the code stops, the output at DTR is again -11V. So is everything going ok according to your kowledge?