Hallo
So habe nun ein Programm für den Atmega 2560.
Mit dem String ON schalte ich alle LEDs ein mit OFF aus.
Soweit so gut.
Nur mit dem C# Programm klappts nicht.
1 | using System;
|
2 | using System.Collections.Generic;
|
3 | using System.ComponentModel;
|
4 | using System.Data;
|
5 | using System.Drawing;
|
6 | using System.Linq;
|
7 | using System.Text;
|
8 | using System.Windows.Forms;
|
9 | using System.IO.Ports;
|
10 |
|
11 | namespace SerialPort
|
12 | {
|
13 | public partial class Form1 : Form
|
14 | {
|
15 | public Form1()
|
16 | {
|
17 | InitializeComponent();
|
18 | }
|
19 |
|
20 | private void button1_Click(object sender, EventArgs e)
|
21 | {
|
22 | //configuring the serial port
|
23 | serialPort1.PortName="COM1";
|
24 | serialPort1.BaudRate=9600;
|
25 | serialPort1.DataBits=8;
|
26 | serialPort1.Parity=Parity.None;
|
27 | serialPort1.StopBits= StopBits.One;
|
28 |
|
29 | //opening the serial port
|
30 | serialPort1.Open();
|
31 |
|
32 | //write data to serial port
|
33 | serialPort1.Write("OFF");
|
34 |
|
35 | //close the port
|
36 | serialPort1.Close();
|
37 |
|
38 |
|
39 | }
|
40 | }
|
41 | }
|
Es blinkt zwar die LED auf dem SmartUSB aber es kommt sonst nichts an.
Erst wenn ich Putty öffne und dann Enter drücker kommt das OFF an.
Wo liegt der Denkfehler??
MFG Christoph