Click here to Skip to main content
15,886,518 members
Home / Discussions / C#
   

C#

 
GeneralRe: led to rs232 Pin
_Q12_1-Nov-09 13:10
_Q12_1-Nov-09 13:10 
GeneralRe: led to rs232 Pin
Christian Graus1-Nov-09 13:33
protectorChristian Graus1-Nov-09 13:33 
AnswerRe: led to rs232 Pin
Alan N1-Nov-09 13:25
Alan N1-Nov-09 13:25 
AnswerRe: led to rs232 Pin
Luc Pattyn1-Nov-09 13:28
sitebuilderLuc Pattyn1-Nov-09 13:28 
GeneralRe: led to rs232 Pin
_Q12_1-Nov-09 13:53
_Q12_1-Nov-09 13:53 
GeneralRe: led to rs232 Pin
Luc Pattyn1-Nov-09 14:15
sitebuilderLuc Pattyn1-Nov-09 14:15 
GeneralRe: led to rs232 Pin
_Q12_1-Nov-09 14:43
_Q12_1-Nov-09 14:43 
GeneralRe: led to rs232 Pin
_Q12_1-Nov-09 16:18
_Q12_1-Nov-09 16:18 
though ... I must put for others the !Finished! customized code :

//if you are to set different time intervals?
//say 100ms to ON state and 400ms to OFF state?
//Here is the answer!   ...and the final finished code!

//all other usings +
using System.IO.Ports;

private  SerialPort port = new SerialPort("COM3", 9600, Parity.Odd, 8, StopBits.One);

        public Form1()
        {
            InitializeComponent();  port.Open();
        }


        private void buttonSS_Click(object sender, EventArgs e)
        {
            if (buttonSS.BackColor==Color.Transparent)
            {
                buttonSS.BackColor = Color.GreenYellow; port.DtrEnable = true;
                timer1.Start(); //timer1.Enabled = !timer1.Enabled;
            }
            else
            {
                buttonSS.BackColor = Color.Transparent;port.DtrEnable = false;
                timer1.Stop(); label1ShowPort.Text = "Closed";
            } 
                
            
        }


        
        private void timer1_Tick(object sender, EventArgs e)
        {
            port.DtrEnable = !port.DtrEnable;

            if (port.DtrEnable)
            {
                timer1.Interval = (int)numericUpDown1.Value;
                label1ShowPort.Text = "sending...";
                label1ShowPort.BackColor = Color.OrangeRed;
            }
            else
            {
                timer1.Interval = (int)numericUpDown2.Value;
                label1ShowPort.BackColor = Color.DarkRed;
                label1ShowPort.Text = "";
            }
        }
      




        private void numericUpDown1_ValueChanged(object sender, EventArgs e)
        {
            timer1.Interval = (int)numericUpDown1.Value;
        }

//pin4 and pin5 are the right connections(DTR+Grd) + 
//+ 1k resistor + 1 bright LED.

//                                 ~Teodor~  

Questionmain form is not activated Pin
Maddie from Dartford1-Nov-09 12:05
Maddie from Dartford1-Nov-09 12:05 
AnswerRe: main form is not activated Pin
Christian Graus1-Nov-09 12:07
protectorChristian Graus1-Nov-09 12:07 
QuestionMaking custom control subscribe to external event ? Need Approach advise... Pin
idan_bismut1-Nov-09 9:30
idan_bismut1-Nov-09 9:30 
AnswerRe: Making custom control subscribe to external event ? Need Approach advise... Pin
Christian Graus1-Nov-09 9:42
protectorChristian Graus1-Nov-09 9:42 
AnswerRe: Making custom control subscribe to external event ? Need Approach advise... Pin
DaveyM691-Nov-09 10:52
professionalDaveyM691-Nov-09 10:52 
Questionhow to create a chart Pin
h.pordel1-Nov-09 9:20
h.pordel1-Nov-09 9:20 
AnswerRe: how to create a chart Pin
Christian Graus1-Nov-09 9:24
protectorChristian Graus1-Nov-09 9:24 
GeneralRe: how to create a chart Pin
h.pordel1-Nov-09 9:39
h.pordel1-Nov-09 9:39 
GeneralRe: how to create a chart Pin
Christian Graus1-Nov-09 9:40
protectorChristian Graus1-Nov-09 9:40 
GeneralRe: how to create a chart Pin
h.pordel1-Nov-09 9:49
h.pordel1-Nov-09 9:49 
GeneralRe: how to create a chart Pin
Christian Graus1-Nov-09 9:51
protectorChristian Graus1-Nov-09 9:51 
GeneralRe: how to create a chart Pin
h.pordel1-Nov-09 9:59
h.pordel1-Nov-09 9:59 
GeneralRe: how to create a chart Pin
Christian Graus1-Nov-09 10:10
protectorChristian Graus1-Nov-09 10:10 
AnswerRe: how to create a chart Pin
Henry Minute1-Nov-09 9:30
Henry Minute1-Nov-09 9:30 
QuestionRedirecting keystrokes to a RichTextBox Control in C# Pin
pbalaga1-Nov-09 9:02
pbalaga1-Nov-09 9:02 
AnswerRe: Redirecting keystrokes to a RichTextBox Control in C# Pin
Christian Graus1-Nov-09 9:14
protectorChristian Graus1-Nov-09 9:14 
GeneralRe: Redirecting keystrokes to a RichTextBox Control in C# Pin
pbalaga3-Nov-09 8:27
pbalaga3-Nov-09 8:27 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.