Click here to Skip to main content
15,909,530 members
Home / Discussions / C#
   

C#

 
AnswerRe: Datagrid checkbox column update Pin
Luc Pattyn2-Nov-11 23:39
sitebuilderLuc Pattyn2-Nov-11 23:39 
AnswerRe: Datagrid checkbox column update Pin
Bernhard Hiller3-Nov-11 22:14
Bernhard Hiller3-Nov-11 22:14 
QuestionHow to run an application action on clicking link Pin
Knightwalker2-Nov-11 11:12
Knightwalker2-Nov-11 11:12 
AnswerRe: How to run an application action on clicking link Pin
Abhinav S2-Nov-11 17:59
Abhinav S2-Nov-11 17:59 
AnswerRe: How to run an application action on clicking link Pin
Mycroft Holmes2-Nov-11 20:24
professionalMycroft Holmes2-Nov-11 20:24 
Questionerror in adding the reference of my web service in C#.net Pin
yousefshokati1-Nov-11 23:32
yousefshokati1-Nov-11 23:32 
AnswerRe: error in adding the reference of my web service in C#.net REPOST Pin
Richard MacCutchan2-Nov-11 0:11
mveRichard MacCutchan2-Nov-11 0:11 
QuestionPlease help with writing to a serial port Pin
turbosupramk31-Nov-11 20:12
turbosupramk31-Nov-11 20:12 
Can anyone tell me why I cannot get this code to write to my serial port (microchip) ?

If I send "pin1=2" via the simpleserial object, it is received and the microchip code reacts. When I try and send it through the below method, the data is not received by the microchip and it does not react.

Thanks for reading.


C#
using System;
using System.Collections.Generic;
using System.Text;
using System.IO.Ports;
using System.Windows.Forms;

namespace SimpleSerial
{
    class test
    {
        private void serialPortWrite()//(string lineToWrite)
        {
            SerialPort serialPort1 = new SerialPort();
            string lineToWrite = "pin1=2";
            serialPort1.PortName = "COM8";
            serialPort1.BaudRate = 115200;
            serialPort1.DataBits = 8;
            serialPort1.Parity = Parity.None;
            serialPort1.StopBits = StopBits.One;
            serialPort1.Open();
            MessageBox.Show(lineToWrite);
            //serialPort1.WriteLine("pin1" + "=" + "1");
            foreach (char chr in lineToWrite)
            {
                char[] buff = new char[1];
                buff[0] = chr;
                serialPort1.Write(buff, 0, 1);
            }

            serialPort1.Close();
        }
    }
}

AnswerRe: Please help with writing to a serial port Pin
BobJanova1-Nov-11 23:51
BobJanova1-Nov-11 23:51 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 2:10
turbosupramk32-Nov-11 2:10 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 3:25
sitebuilderLuc Pattyn2-Nov-11 3:25 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 3:55
turbosupramk32-Nov-11 3:55 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 4:22
sitebuilderLuc Pattyn2-Nov-11 4:22 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 5:48
turbosupramk32-Nov-11 5:48 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 6:52
sitebuilderLuc Pattyn2-Nov-11 6:52 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 9:00
turbosupramk32-Nov-11 9:00 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 9:11
sitebuilderLuc Pattyn2-Nov-11 9:11 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 9:54
turbosupramk32-Nov-11 9:54 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 10:10
sitebuilderLuc Pattyn2-Nov-11 10:10 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 11:03
turbosupramk32-Nov-11 11:03 
AnswerRe: Please help with writing to a serial port Pin
Luc Pattyn2-Nov-11 11:20
sitebuilderLuc Pattyn2-Nov-11 11:20 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 11:37
turbosupramk32-Nov-11 11:37 
GeneralRe: Please help with writing to a serial port Pin
Rob Philpott2-Nov-11 7:34
Rob Philpott2-Nov-11 7:34 
AnswerRe: Please help with writing to a serial port Pin
PIEBALDconsult2-Nov-11 9:00
mvePIEBALDconsult2-Nov-11 9:00 
GeneralRe: Please help with writing to a serial port Pin
turbosupramk32-Nov-11 9:10
turbosupramk32-Nov-11 9:10 

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.