Things used in this project

Hardware components:
09590 01
LED (generic)
×1
lattepanda
×1
Software apps and online services:
Vs2015logo
Microsoft Visual Studio 2015
Ide web
Arduino Arduino IDE

Code

Code snippet #1Plain text
public partial class Form1 : Form    {
        SerialPort port;        public Form1()
        {
            InitializeComponent();            this.FormClosed += new FormClosedEventHandler(Form1_FormClosed);            if (port == null)
            {
                //Change the portname according to your computer
                port = new SerialPort("COM4", 9600);
                port.Open();
            }
        }void Form1_FormClosed(object sender, FormClosedEventArgs e)        {
            if (port != null && port.IsOpen)
            {
                port.Close();
            }
        }private void button1_Click(object sender, EventArgs e)        {
            
                PortWrite("1");
            
        }        
        private void button2_Click(object sender, EventArgs e)
        {
           
                PortWrite("0");
            
        }private void PortWrite(string message)        {
            if (port != null && port.IsOpen)
            {
                port.Write(message);
            }
        }
    }
Code snippet #2Plain text
const int LedPin = 3;int ledState = 0;void setup()
{ 
  pinMode(LedPin, OUTPUT);
  
  Serial.begin(9600);  
}void loop()
{ 
    char receiveVal;   
   
    if(Serial.available() > 0)
    {        
        receiveVal = Serial.read();
        
       if(receiveVal == '1')    
          ledState = 1;   
       else
          ledState = 0;     
    }   
      
    digitalWrite(LedPin, ledState); 
      
    delay(50);    
}

Credits

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

Sorting Hat: Circuit Playground Express Starter Project
Easy
  • 385
  • 5

Protip

Which Hogwarts House do you belong in? A quick first project for this beginner-friendly board from Adafruit.

Getting Started - Cortana Skills, Bot Framework, RaspberryPi
Easy
  • 1,540
  • 10

Protip

Gentle introduction to Cortana Skills and Bot Framework connecting to Raspberry Pi, using Cortana Skills to Echo sent message.

Connect Raspberry pi and PC with TCP/IP using Csharp
Easy
  • 328
  • 1

Connect a Raspberry Pi Model 2|3 B (Windows IoT core) and PC (Wiindows 7,8,10) with TCP/IP protocol using Csharp Network Classes

Awesome Azure IoT
Easy
  • 219
  • 1

A curated list of awesome Azure Internet of Things projects and resources.

Microsoft Workshop Setup Guide
Easy
  • 1,427
  • 12

Protip

A collection of screencasts for setting up your laptop for the Hackster/Microsoft IoT Roadshow events.

One Small Step For a Yedi, One Giant Leap for Mankind
Easy
  • 242
  • 4

Work in progress

Counting your steps with the Calliope Mini. Hearing the Star Wars theme is always a huge motivator.

Add projectSign up / Login