Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

John EE

@John EE
About
Posts
5
Topics
3
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • C# Button Click for UART COM
    J John EE

    Ok I have setup a simple gui for uart. I am trying to light up 4 LEDS thru a MC. LED0 will be 0x01, LED 1, 2, 3 will be 2, 4, 8. Will this send out the appropriate command I am looking for. This will have to be sent out through TxD. I have no way to test it until tomorrow because I do not have the hardware with me but was wondering if this would suffice. I do not get any errors or warnings so I am thinking it should. Thanks

    #region Buttons

        private void buttonLED0\_Click\_1(object sender, EventArgs e)
        {
            Data = Data ^= 0x01;
            int BytesToWrite = Data;
            int bytes = serialPort1.BytesToWrite;
            //UInt32 numBytesWritten = 1;
            buttonLED0.Enabled = !buttonLED0.Enabled;
            
            if (buttonLED0.Enabled)
            {
                pictureBoxLED0.BackgroundImage = imageList1.Images\[(int)LEDColor.GreenOn\];
            }
    
            if (!buttonLED0.Enabled)
            {
                
                pictureBoxLED0.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOn\];
            } 
        }
    
    COM csharp com hardware workspace

  • C# Button Click for UART
    J John EE

    By the way this will have to be sent out thru the TXD.

    C# csharp hardware workspace

  • C# Button Click for UART
    J John EE

    Ok I have setup a simple gui for uart. I am trying to light up 4 LEDS thru a MC. LED0 will be 0x01, LED 1, 2, 3 will be 2, 4, 8. Will this send out the appropriate command I am looking for. I have no way to test it until tomorrow because I do not have the hardware with me but was wondering if this would suffice. I do not get any errors or warnings so I am thinking it should. Thanks

    private void buttonLED0_Click_1(object sender, EventArgs e)
    {
    Data = Data ^= 0x01;
    int BytesToWrite = Data;
    int bytes = serialPort1.BytesToWrite;
    //UInt32 numBytesWritten = 1;
    buttonLED0.Enabled = !buttonLED0.Enabled;

            if (buttonLED0.Enabled)
            {
                pictureBoxLED0.BackgroundImage = imageList1.Images\[(int)LEDColor.GreenOn\];
            }
    
            if (!buttonLED0.Enabled)
            {
                
                pictureBoxLED0.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOn\];
            } 
        }
    
    C# csharp hardware workspace

  • C# GUI build for UART FT232
    J John EE

    any help would be good?

    C# csharp

  • C# GUI build for UART FT232
    J John EE

    I am building a GUI for a UART to communicate to a MC and then to a I/O expander. Right now I have the data going thru the RTS and DTS and my switches monitored by CTS DSR DCD and RI. How could I change this to be implemented to use only TX and RX for all of this without having to start all over. I am not real great with programming but I do know enough to understand. I have included the piece of code that I use for this part.

     #region Initialization
        public enum LEDColor { RedOn, RedOff, GreenOn, GreenOff }
    
        private bool RTSState = false;
        private bool DTRState = false;
        private bool RingIndicator = false;
    
        public Form1()
        {
            InitializeComponent();
    
            pictureBoxRTS.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
            pictureBoxDTR.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
            pictureBoxCTS.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
            pictureBoxDSR.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
            pictureBoxDCD.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
            pictureBoxRI.BackgroundImage = imageList1.Images\[(int)LEDColor.RedOff\];
        }
        #endregion
    
    
        #region Modem lines
        // Show the modem states on the virtual LEDs
        private void serialPort1\_PinChanged(object sender, System.IO.Ports.SerialPinChangedEventArgs e)
        {
            // Toggle RI since we can't determine the state with the SerialPort class
            if (e.EventType == SerialPinChange.Ring) RingIndicator = !RingIndicator;
    
            showCTS\_DSR\_CD();
        }
    
        private void showCTS\_DSR\_CD()
        {
            if (serialPort1.IsOpen)
            {
                if (serialPort1.CtsHolding) this.pictureBoxCTS.BackgroundImage = this.imageList1.Images\[(int)LEDColor.GreenOn\];
                else this.pictureBoxCTS.BackgroundImage = this.imageList1.Images\[(int)LEDColor.RedOn\];
    
                if (serialPort1.DsrHolding) this.pictureBoxDSR.BackgroundImage = this.imageList1.Images\[(int)LEDColor.GreenOn\];
                else this.pictureBoxDSR.BackgroundImage = this.imageList1.Images\[(int)LEDColor.RedOn\];
    
                if (serialPort1.CDHolding) this.pictureBoxDCD.BackgroundImage = this.imageList1.Images\[(int)LEDColor.GreenOn\];
                else this.pictureBoxDCD.BackgroundImage = this.imageList1.Images\[(int)LEDColor.RedOn\];
    
                if (RingIndicator) this.pict
    
    C# csharp
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups