using System;
using System.Collections.Generic;
using System.Drawing;
using System.Windows.Forms;
using ICSharpCode.USBlib;
using AvrUsbExpBoardNameSpace;
namespace AVR_USB_Windows1
{
public partial class MainForm
{
static AvrUsbExpBoard Avr1;
[STAThread]
public static void Main(string[] args)
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Avr1 = AvrUsbExpBoard.Instance;
try
{
Avr1.Open();
}
catch(MethodCallUsbException)
{
// Show a message box with OK and Help buttons.
DialogResult r = MessageBox.Show("USB-Dongle HARDWARE NOT FOUND ",
"Error",
MessageBoxButtons.OK,
MessageBoxIcon.Question,
MessageBoxDefaultButton.Button1,
0, true);
Environment.Exit(1);
}
Application.Run(new MainForm());
Avr1.Dispose();
}
public MainForm()
{
//
// The InitializeComponent() call is required for Windows Forms designer support.
//
InitializeComponent();
//
// TODO: Add constructor code after the InitializeComponent() call.
//
}
void Button1Click(object sender, System.EventArgs e)
{
this.Close();
}
private void buttonD5_Click(object sender, EventArgs e)
{
Avr1.SetEEProm (00,11);
Avr1.SetEEProm(01, 12);
Avr1.SetEEProm(02, 12);
Avr1.SetEEProm(03, 255);
Avr1.SetEEProm(04, 12);
textBox2.Text = Convert.ToString((Avr1.GetEEProm(03)));
}
private void READ_Click(object sender, EventArgs e)
{
textBox6.Text = Convert.ToString((Avr1.GetEEProm(00)));
textBox7.Text = Convert.ToString((Avr1.GetEEProm(01)));
textBox8.Text = Convert.ToString((Avr1.GetEEProm(02)));
textBox9.Text = Convert.ToString((Avr1.GetEEProm(03)));
textBox10.Text = Convert.ToString((Avr1.GetEEProm(04)));
}
private void CREATE_Click(object sender, EventArgs e)
{
Avr1.SetEEProm(00,Convert.ToChar(textBox1 .Text ));
Avr1.SetEEProm(01, Convert.ToChar(textBox2.Text));
Avr1.SetEEProm(02, Convert.ToChar(textBox3.Text));
Avr1.SetEEProm(03, Convert.ToChar(textBox4.Text));
Avr1.SetEEProm(04, Convert.ToChar(textBox5.Text));
}
private void button2_Click(object sender, EventArgs e)
{
textBox1.Text ="00";
textBox2.Text = "00";
textBox3.Text = "00";
textBox4.Text = "00";
textBox5.Text = "00";
}
private void button3_Click(object sender, EventArgs e)
{
textBox6.Text = "";
textBox7.Text = "";
textBox8.Text = "";
textBox9.Text = "";
textBox10.Text = "";
}
}
}
The output im getting is that if i write a String in textbox1 its ASCII value will be displayed in the textbox6 .
But the problem is that i want to display the string, i entered in the textbox1..
So please help me regarding the problem i mentioned above..
Thanks in advance.