elhacker.net cabecera Bienvenido(a), Visitante. Por favor Ingresar o Registrarse
¿Perdiste tu email de activación?.

 

 


Tema destacado: Introducción a la Factorización De Semiprimos (RSA)


  Mostrar Temas
Páginas: 1 ... 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 [60] 61 62 63 64 65 66
591  Programación / .NET (C#, VB.NET, ASP) / Pasar de VC# a VB en: 22 Diciembre 2008, 06:10 am
Hola:

Hace tiempo hice un manual sobre Visual C# con PIC 16F84A, de tanta demanda estoy con ganas de pasarlo a Visual Basic 2008 Express. No se nada de este lenguaje y me gustaría colaboración de convertir el código que ya tengo hecho de VC# a VB .net.

El manual es este de abajo, pero quiero hacerlo en un PDF a parte.
http://electronicapic.iespana.es/manual/picrs232.pdf

Puedes descargar el código fuente completo de Visual C# para que lo vean y si pueden pasarlo a Visual Basic 2008.
http://www.pic16f84a.org/index.php?option=com_docman&task=doc_download&gid=53&Itemid=59
Contraseña: D.P.E.

El que quiera colaborar y aparecer su e-mail, web o demás información para ponerlo al final del manual. Me envías el archivo ya con el código fuente completo en Visual Basic 2008 Express y sus comentarios explicado en las líneas de código al e-mail metacontaARROBAgmail.com

Un cordial saludo.

EDITO:
He intentado hacer el código de C# a VB en esta web http://www.developerfusion.com/tools/convert/csharp-to-vb/

El código en Form1.vb puse:
Código:
Imports System
Imports System.Collections.Generic
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Linq
Imports System.Text
Imports System.Windows.Forms
Imports System.IO.Ports

Namespace PicRS232
    Partial Public Class Form1_Principal
        Inherits Form
        ' Utilizaremos un string como buffer de recepcion
        Private Recibidos As String
        Public Sub New()
            InitializeComponent()
            ' Abrir puerto mientra se ejecute la aplicación
            If Not serialPort1.IsOpen Then
                Try
                    serialPort1.Open()
                Catch ex As System.Exception
                    MessageBox.Show(ex.ToString())
                End Try
            End If
            ' Ejecutar la funcion Recepcion por disparo del Evento 'DataReived'
            AddHandler serialPort1.DataReceived, AddressOf Recepcion
        End Sub
        ' Al recibir los datos
        Private Sub Recepcion(ByVal sender As Object, ByVal e As System.IO.Ports.SerialDataReceivedEventArgs)
            ' Acumular los carácteres recibidos a nuestro 'buffer' (string)
            Recibidos += serialPort1.ReadExisting()
            ' Invocar o llamar al proceso de tramas
            Me.Invoke(New EventHandler(Actualizar))
        End Sub
        ' Procesar los datos recibidos en el buffer y extraer tramas completas
        Private Sub Actualizar(ByVal s As Object, ByVal e As EventArgs)
            ' Asignar el valor de la trama al textBox
            textBox_visualizar_mensaje.Text = Recibidos
        End Sub
        Private Sub button_t_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim mBuffer As Byte() = New Byte(0) {}
            mBuffer(0) = &H74
            'ASCII letra "t".
            serialPort1.Write(mBuffer, 0, mBuffer.Length)
        End Sub

        Private Sub button_b_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim miBuffer As Byte() = New Byte(0) {}
            miBuffer(0) = &H62
            'ASCII letra "b".
            serialPort1.Write(miBuffer, 0, miBuffer.Length)
        End Sub

        Private Sub button_a_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim mBuffer As Byte() = New Byte(0) {}
            mBuffer(0) = &H61
            'ASCII letra "a".
            serialPort1.Write(mBuffer, 0, mBuffer.Length)
        End Sub

        Private Sub button_l_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim mBuffer As Byte() = New Byte(0) {}
            mBuffer(0) = &H6C
            'ASCII letra "l".
            serialPort1.Write(mBuffer, 0, mBuffer.Length)
        End Sub

        Private Sub button_Espacio_Click(ByVal sender As Object, ByVal e As EventArgs)
            Dim mBuffer As Byte() = New Byte(0) {}
            mBuffer(0) = &H20
            'ASCII letra "Espacio".
            serialPort1.Write(mBuffer, 0, mBuffer.Length)
        End Sub

        Private Sub timer1_Tick(ByVal sender As Object, ByVal e As EventArgs)
            statusStrip1.Items(0).Text = DateTime.Now.ToLongTimeString()
        End Sub
    End Class
End Namespace




Ahora en Form1.Designer.vb puse:

Código:
Namespace PicRS232
    Partial Class Form1_Principal
        ''' <summary>
        ''' Variable del diseñador requerida.
        ''' </summary>
        Private components As System.ComponentModel.IContainer = Nothing

        ''' <summary>
        ''' Limpiar los recursos que se estén utilizando.
        ''' </summary>
        ''' <param name="disposing">true si los recursos administrados se deben eliminar; false en caso contrario, false.</param>
        Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
            If disposing AndAlso (components IsNot Nothing) Then
                components.Dispose()
            End If
            MyBase.Dispose(disposing)
        End Sub

#Region "Código generado por el Diseñador de Windows Forms"

        ''' <summary>
        ''' Método necesario para admitir el Diseñador. No se puede modificar
        ''' el contenido del método con el editor de código.
        ''' </summary>
        Private Sub InitializeComponent()
            Me.components = New System.ComponentModel.Container()
            Me.button_t = New System.Windows.Forms.Button()
            Me.button_b = New System.Windows.Forms.Button()
            Me.button_a = New System.Windows.Forms.Button()
            Me.button_l = New System.Windows.Forms.Button()
            Me.button_Espacio = New System.Windows.Forms.Button()
            Me.serialPort1 = New System.IO.Ports.SerialPort(Me.components)
            Me.statusStrip1 = New System.Windows.Forms.StatusStrip()
            Me.textBox_visualizar_mensaje = New System.Windows.Forms.TextBox()
            Me.label_mensaje_pic = New System.Windows.Forms.Label()
            Me.timer1 = New System.Windows.Forms.Timer(Me.components)
            Me.toolStripStatusLabel1 = New System.Windows.Forms.ToolStripStatusLabel()
            Me.statusStrip1.SuspendLayout()
            Me.SuspendLayout()
            '
            ' button_t
            '
            Me.button_t.Location = New System.Drawing.Point(109, 38)
            Me.button_t.Name = "button_t"
            Me.button_t.Size = New System.Drawing.Size(75, 23)
            Me.button_t.TabIndex = 0
            Me.button_t.Text = "t"
            Me.button_t.UseVisualStyleBackColor = True
            AddHandler Me.button_t.Click, AddressOf Me.button_t_Click
            '
            ' button_b
            '
            Me.button_b.Location = New System.Drawing.Point(109, 67)
            Me.button_b.Name = "button_b"
            Me.button_b.Size = New System.Drawing.Size(75, 23)
            Me.button_b.TabIndex = 1
            Me.button_b.Text = "b"
            Me.button_b.UseVisualStyleBackColor = True
            AddHandler Me.button_b.Click, AddressOf Me.button_b_Click
            '
            ' button_a
            '
            Me.button_a.Location = New System.Drawing.Point(28, 67)
            Me.button_a.Name = "button_a"
            Me.button_a.Size = New System.Drawing.Size(75, 23)
            Me.button_a.TabIndex = 2
            Me.button_a.Text = "a"
            Me.button_a.UseVisualStyleBackColor = True
            AddHandler Me.button_a.Click, AddressOf Me.button_a_Click
            '
            ' button_l
            '
            Me.button_l.Location = New System.Drawing.Point(190, 67)
            Me.button_l.Name = "button_l"
            Me.button_l.Size = New System.Drawing.Size(75, 23)
            Me.button_l.TabIndex = 3
            Me.button_l.Text = "l"
            Me.button_l.UseVisualStyleBackColor = True
            AddHandler Me.button_l.Click, AddressOf Me.button_l_Click
            '
            ' button_Espacio
            '
            Me.button_Espacio.BackColor = System.Drawing.Color.FromArgb(CInt(CByte((255))), CInt(CByte((128))), CInt(CByte((0))))
            Me.button_Espacio.Location = New System.Drawing.Point(190, 96)
            Me.button_Espacio.Name = "button_Espacio"
            Me.button_Espacio.Size = New System.Drawing.Size(75, 23)
            Me.button_Espacio.TabIndex = 4
            Me.button_Espacio.Text = "Espacio"
            Me.button_Espacio.UseVisualStyleBackColor = False
            AddHandler Me.button_Espacio.Click, AddressOf Me.button_Espacio_Click
            '
            ' serialPort1
            '
            Me.serialPort1.StopBits = System.IO.Ports.StopBits.Two
            '
            ' statusStrip1
            '
            Me.statusStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.toolStripStatusLabel1})
            Me.statusStrip1.Location = New System.Drawing.Point(0, 244)
            Me.statusStrip1.Name = "statusStrip1"
            Me.statusStrip1.Size = New System.Drawing.Size(292, 22)
            Me.statusStrip1.TabIndex = 7
            Me.statusStrip1.Text = "statusStrip1"
            '
            ' textBox_visualizar_mensaje
            '
            Me.textBox_visualizar_mensaje.Anchor = DirectCast(((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) Or System.Windows.Forms.AnchorStyles.Left) Or System.Windows.Forms.AnchorStyles.Right)), System.Windows.Forms.AnchorStyles)
            Me.textBox_visualizar_mensaje.Location = New System.Drawing.Point(0, 162)
            Me.textBox_visualizar_mensaje.Multiline = True
            Me.textBox_visualizar_mensaje.Name = "textBox_visualizar_mensaje"
            Me.textBox_visualizar_mensaje.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
            Me.textBox_visualizar_mensaje.Size = New System.Drawing.Size(292, 82)
            Me.textBox_visualizar_mensaje.TabIndex = 6
            '
            ' label_mensaje_pic
            '
            Me.label_mensaje_pic.AutoSize = True
            Me.label_mensaje_pic.Location = New System.Drawing.Point(25, 146)
            Me.label_mensaje_pic.Name = "label_mensaje_pic"
            Me.label_mensaje_pic.Size = New System.Drawing.Size(110, 13)
            Me.label_mensaje_pic.TabIndex = 5
            Me.label_mensaje_pic.Text = "Mensaje desde el PIC"
            '
            ' timer1
            '
            Me.timer1.Enabled = True
            Me.timer1.Interval = 1000
            AddHandler Me.timer1.Tick, AddressOf Me.timer1_Tick
            '
            ' toolStripStatusLabel1
            '
            Me.toolStripStatusLabel1.Name = "toolStripStatusLabel1"
            Me.toolStripStatusLabel1.Size = New System.Drawing.Size(53, 17)
            Me.toolStripStatusLabel1.Text = "hh:mmTongue Tieds"
            '
            ' Form1_Principal
            '
            Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0F, 13.0F)
            Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
            Me.ClientSize = New System.Drawing.Size(292, 266)
            Me.Controls.Add(Me.label_mensaje_pic)
            Me.Controls.Add(Me.textBox_visualizar_mensaje)
            Me.Controls.Add(Me.statusStrip1)
            Me.Controls.Add(Me.button_Espacio)
            Me.Controls.Add(Me.button_l)
            Me.Controls.Add(Me.button_a)
            Me.Controls.Add(Me.button_b)
            Me.Controls.Add(Me.button_t)
            Me.Name = "Form1_Principal"
            Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
            Me.Text = "PicRS232"
            Me.statusStrip1.ResumeLayout(False)
            Me.statusStrip1.PerformLayout()
            Me.ResumeLayout(False)
            Me.PerformLayout()

        End Sub

#End Region

        Private button_t As System.Windows.Forms.Button
        Private button_b As System.Windows.Forms.Button
        Private button_a As System.Windows.Forms.Button
        Private button_l As System.Windows.Forms.Button
        Private button_Espacio As System.Windows.Forms.Button
        Private serialPort1 As System.IO.Ports.SerialPort
        Private statusStrip1 As System.Windows.Forms.StatusStrip
        Private textBox_visualizar_mensaje As System.Windows.Forms.TextBox
        Private label_mensaje_pic As System.Windows.Forms.Label
        Private timer1 As System.Windows.Forms.Timer
        Private toolStripStatusLabel1 As System.Windows.Forms.ToolStripStatusLabel
    End Class


End Namespace

Al ejecutar me sale error:
Error    1    El delegado 'System.EventHandler' requiere una expresión 'AddressOf' o una expresión lambda como único argumento de su constructor.    C:\Documents and Settings\Hunter\Mis documentos\Visual Studio 2008\Projects\prueba1\prueba1\Form1.vb    34    40    prueba1

Otro error.
Error    2    'Form1' no es un miembro de 'prueba1'.    C:\Documents and Settings\Hunter\Mis documentos\Visual Studio 2008\Projects\prueba1\prueba1\My Project\Application.Designer.vb    35    27    prueba1

Código:
'------------------------------------------------------------------------------
' <auto-generated>
'     This code was generated by a tool.
'     Runtime Version:2.0.50727.3053
'
'     Changes to this file may cause incorrect behavior and will be lost if
'     the code is regenerated.
' </auto-generated>
'------------------------------------------------------------------------------

Option Strict On
Option Explicit On


Namespace My
   
    'NOTE: This file is auto-generated; do not modify it directly.  To make changes,
    ' or if you encounter build errors in this file, go to the Project Designer
    ' (go to Project Properties or double-click the My Project node in
    ' Solution Explorer), and make changes on the Application tab.
    '
    Partial Friend Class MyApplication
       
        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Public Sub New()
            MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
            Me.IsSingleInstance = false
            Me.EnableVisualStyles = true
            Me.SaveMySettingsOnExit = true
            Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
        End Sub
       
        <Global.System.Diagnostics.DebuggerStepThroughAttribute()>  _
        Protected Overrides Sub OnCreateMainForm()
            Me.MainForm = Global.PicRS232.Form1
        End Sub
    End Class
End Namespace

Necesito ayuda.
592  Programación / Programación Visual Basic / Pasar de VB6 a C# y/o VB .net en: 9 Diciembre 2008, 22:08 pm
Hola:

Quiero cambiar el código de VB6 a C# y/o VB .net en esta web pero me da error porque solo acepta VB .net
http://www.developerfusion.com/tools/convert/csharp-to-vb/

El código que deseo cambiar de VB6 a C# es este de aquí abajo.

Código:
Private Sub conectar_Click()
'comprueva que el puerto este cerrado para poder abrirlo
If MSComm1.PortOpen = False Then
'determina el puerto que hemos seleccionado.
If COM_sel.ListIndex = 0 Then
MSComm1.CommPort = 1
End If
If COM_sel.ListIndex = 1 Then
MSComm1.CommPort = 2
End If
If COM_sel.ListIndex = 2 Then
MSComm1.CommPort = 3
End If
If COM_sel.ListIndex = 3 Then
MSComm1.CommPort = 4
End If
If COM_sel.ListIndex = 4 Then
MSComm1.CommPort = 5
End If
If COM_sel.ListIndex = 5 Then
MSComm1.CommPort = 6
End If
If COM_sel.ListIndex = 6 Then
MSComm1.CommPort = 7
End If
If COM_sel.ListIndex = 7 Then
MSComm1.CommPort = 8
End If
If COM_sel.ListIndex = 8 Then
MSComm1.CommPort = 9
End If
If COM_sel.ListIndex = 9 Then
MSComm1.CommPort = 10
End If
If COM_sel.ListIndex = 10 Then
MSComm1.CommPort = 11
End If
End If

MSComm1.OutBufferSize = 1 'tamaño del dato a transmitir.
MSComm1.InBufferSize = 23
MSComm1.InputMode = comInputModeText 'los datos se recuperan en modo texto.
MSComm1.InputLen = 23 ' BUFFER DE ENTRADA SE PUEDE DEJAR AL MAXIMO.
MSComm1.PortOpen = True
MSComm1.RThreshold = 23 'son 23 caracteres.
End Sub

Private Sub Form_Load()
COM_sel.AddItem "COM1"
COM_sel.AddItem "COM2"
COM_sel.AddItem "COM3"
COM_sel.AddItem "COM4"
COM_sel.AddItem "COM5"
COM_sel.AddItem "COM6"
COM_sel.AddItem "COM7"
COM_sel.AddItem "COM8"
COM_sel.AddItem "COM9"
COM_sel.AddItem "COM10"
COM_sel.AddItem "COM11"
COM_Sel.ListIndex = 0
End Sub

Private Sub MSComm1_OnComm()
Dim InBuff As String
Select Case MSComm1.CommEvent
Case comEvReceive
InBuff = MSComm1.Input
Debug.Print InBuff
Texto.Text = ""
Texto.Text = Left$(InBuff, 23) ' se recorta los caracteres basura
MSComm1.PortOpen = False 'cierra el puerto y vacia el buffer
End Select
End Sub

Saludo.
593  Programación / .NET (C#, VB.NET, ASP) / Pasar código de Visual a MonoDevelop en: 9 Diciembre 2008, 00:33 am
Hola:

Hice un manual para del puerto serie controlado con Visual C# .net Express 2008. Al menos hay códigos que deseo pasarlo a Linux con MonoDevelop GTK# (C#).

El manual es este:
Ver manual

El código fuente al que deseo pasar a Linux es este (de la página 162 del manual):
Descargar FUENTE 1

Contraseña = D.P.E.

Si no pueden descargarlo, me avisan.

Necesito colaboradores para ampliar el manual. Por otra parte estoy pasándolo con Visual Basic y Visual C++ 2008.

Ver vídeo:
http://www.youtube.com/watch?v=niWAbQ-HVnY

Quiero que los usuarios de Windows, también entren a Linux y vean sus mismas posibilidades.

Un cordial saludo.

EDITO:

El código de Visual C# es este y quiero pasarlo a GTK# de MonoDevelop.
Código:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.IO.Ports;

namespace PicRS232
{
    public partial class Form1_Principal : Form
    {
        public Form1_Principal()
        {
            InitializeComponent();
            // Abrir puerto mientra se ejecute la aplicación
            if (!serialPort1.IsOpen)
            {
                try
                {
                    serialPort1.Open();
                }
                catch (System.Exception ex)
                {
                    MessageBox.Show(ex.ToString());
                }
            }
        }

        private void button_t_Click(object sender, EventArgs e)
        {
            byte[] mBuffer = new byte[1];
            mBuffer[0] = 0x74; //ASCII letra "t".
            serialPort1.Write(mBuffer, 0, mBuffer.Length);
        }

        private void button_b_Click(object sender, EventArgs e)
        {
            byte[] miBuffer = new byte[1];
            miBuffer[0] = 0x62; //ASCII letra "b".
            serialPort1.Write(miBuffer, 0, miBuffer.Length);
        }

        private void button_a_Click(object sender, EventArgs e)
        {
            byte[] mBuffer = new byte[1];
            mBuffer[0] = 0x61; //ASCII letra "a".
            serialPort1.Write(mBuffer, 0, mBuffer.Length);
        }

        private void button_l_Click(object sender, EventArgs e)
        {
            byte[] mBuffer = new byte[1];
            mBuffer[0] = 0x6C; //ASCII letra "l".
            serialPort1.Write(mBuffer, 0, mBuffer.Length);
        }

        private void button_Espacio_Click(object sender, EventArgs e)
        {
            byte[] mBuffer = new byte[1];
            mBuffer[0] = 0x20; //ASCII letra "Espacio".
            serialPort1.Write(mBuffer, 0, mBuffer.Length);
        }
    }
}

Dejo claro que el Visual C# uso un componente llamado serialPort1 en el que MonoDevelop no incluye. Ese es el problema que tengo. En Visual C# su configuración del componente serialPort1 está en la página 143 de este MANUAL.

Saludo.
594  Programación / .NET (C#, VB.NET, ASP) / Configuración serialPort en C# en: 7 Diciembre 2008, 05:32 am
Hola:

Estoy trabajando con MonoDevelop en openSUSE 11.0 y me gustaría saber si esto está bien configurado así, ya que me da error.

Código:
serialPort1 = new SerialPort("/dev/ttyS0",9600, Parity.None, 8, StopBits.Two);

Un cordial saludo.
595  Programación / Programación Visual Basic / Hacer manual de puerto serie y paralelo en VB6 en: 6 Diciembre 2008, 03:23 am
Hola:

¿Alguien le interesa controlar puerto serie y paralelo con Visual Basic 6 o .net 2008 Express?

Lo incluiré en la parte II de este manual en C#.

Ver aqui:
http://foro.elhacker.net/electronica/manual_puerto_serie_rs232_con_pic16f84a_controlado_por_visual_c-t237403.0.html

Un cordial salido
596  Informática / Electrónica / Manual Puerto serie RS232 Con PIC16F84A controlado por Visual C# en: 4 Diciembre 2008, 21:57 pm
Hola:

Presento Manual Puerto serie RS232 Con PIC16F84A controlado por Visual C# en el que podrás aprender a controlar un PIC mediante una Interfaz en el PC bajo Visual C# .net.

Aún así, por falta de tiempo no he acabado la parte de MonoDevelop en Linux cosa que haré en el futuro ya en el 2009. Que sepan que también continuaré solo las primeras 200 páginas con Visual Basic .net (depende de la demanda lo haré también con Visual Basic 6) y Visual C++ otras 200.

Por ahora no he encontrado un lugar donde poder descargarlo directamente en PDF.

Ver Manual

Descargar 1ª parte
Descargar 2ª parte

Si estás registrado, hay una opción para bajarlo en PDF.

Ver vídeo:
http://www.youtube.com/watch?v=niWAbQ-HVnY

Espero cualquier opinión, duda, preguntas sobre errores que puedan encontrar y mejoras del manual.

Un cordial saludo.
597  Programación / .NET (C#, VB.NET, ASP) / Hacer un cuadro de infomación en: 2 Noviembre 2008, 01:33 am

Hola:

Quiero hacer un cuadro de información que tiene todos los programas normalmente llamado "Acerca de...". Por ejemplo en el navegador Mozilla Firefox. Al pulsar Acerca de... y luego el botón Créditos, se ve una lista de colaboradores que sube hacia arriba. ¿Cómo se hace ese efecto?

Saludo.
598  Programación / .NET (C#, VB.NET, ASP) / Recibir datos del puerto serie en bytes. en: 27 Octubre 2008, 22:38 pm
Hola:

En este enlace del mismo foro http://forums.microsoft.com/MSDN-ES/ShowPost.aspx?PostID=3836544&SiteID=11
Puedo enviar datos de un byte al puerto serie de esta manera:

Este código dentro de un Button

byte[] miBuffer = new byte[1];

            miBuffer[0] = 0x74; // Letra "t" del ASCII.

            this.serialPort1.Write(miBuffer, 0, miBuffer.Length);


Me gustaría recibir un byte, pero no se como se hace.
Por ejemplo:
Tengo 8 Button o botones en el formulario o Form1 para enviar datos de un bytes como muestra el código de ahí arriba. Otros 8 Button de sólo lectura, es decir, que sólo detecta activado o desactivado, 1 ó 0, True o False. Si recibe un bytes para un button, que lo reconozca.

Creo que con un if else me basta.

Un cordial saludo.

EDIT:
Tal vez no me expresé bien.

¿Cómo se recibe un byte al puerto serie serialPort1?

Por ejemplo:
Un 0x61 en haxadecimal en ASCII es la letra a. Desde que reciba el 0x61 al puerto serie del ordenador o PC que el botón que se muestra en la imagen de abajo, se lea un 1 o un 0. En este caso un 1.

0x61 = 1 // button1.Text = "1";
0x60 = 0 //button1.Text = "0";




Si recibe un 0x61 se ejecuta la instrucción // button1.Text = "1";
Si recibe un 0x60 se ejecuta la otra instrucción // button1.Text = "0";

Esto solo es para saber el estado.
599  Informática / Electrónica / Manual IC-Prog en PDF en: 20 Octubre 2008, 04:21 am
Hola:

Presento un manual del programador de PIC IC-Prog más usado y popular. Pueden dejar cualquier comentario si ven algún fallo, alguna sugerencia para mejorarlo, etc.

Descarga

Más manuales aquí.

Un cordial saludos.
600  Programación / Scripting / Manejar el regedit con el batch en: 16 Octubre 2008, 21:17 pm
Hola:

Me gustaría modificar el editor de registro de Windows con los archivos batch. Tengo el ic-prog ya configurado y esa configuración se guarda en el editor de registro de Windows (regedit).

Al configurar el ic-prog se queda guardado la configuración completa que en el regedit lo exporta a un archivo llamado *.reg donde se encuentra la información de la configuración.

Código:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\IC-Prog]

[HKEY_CURRENT_USER\IC-Prog\Settings]
"Programmer"="0"
"ExtProgrammer"="0"
"Api"="1"
"InvertDataOut"="0"
"InvertDataIn"="0"
"InvertSCK"="0"
"InvertMCLR"="0"
"InvertVCC"="0"
"InvertVPP"="0"
"IODelay"="10"
"Port"="Com2"
"Device"="138"
"Progging"="1"
"Erasing"="0"
"Overwrite"="0"
"IDCheck"="0"
"ConfigCheck"="0"
"Verify"="1"
"Priority"="0"
"VerDurProg"="0"
"EnableMCLR"="0"
"ByteWrite"="0"
"PowerControl"="0"
"Warning"="0"
"Device1"="0"
"Device2"="0"
"Device3"="0"
"Device4"="0"
"CodeType"="0"
"DataType"="0"
"DragDrop"="0"
"SmartWiz"="0"
"Shell"="0"
"SmartMouse"="0"
"OutHigh"="0"
"Language"="1"
"Freq"="0"
"SmartPort"="1"
"I2CAddress"="0"
"Protocol"="0"
"Development"="0"
"DTRasVCC"="1"
"SelectDevice"="0"
"UsesDriver"="1"
"Smart"="0"


Se puede perfectamente borrar esta configuración desde el regedit, cuya zona hay que tener cuidado. ¿Cuál es el código de bat para borrar la configuración completa que se llama ic-prog y que ese archivo bat antes que nada te pregunte que si quieres borrar y cuando borras salga el mensaje borrado?

Supongamos que no hay nada guardado. Para no tener que configurar de nuevo ya que lo tengo guardado en un archivo *.reg y ya con eso tengo la configuración otra vez.

Un cordial saludo.
Páginas: 1 ... 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 [60] 61 62 63 64 65 66
WAP2 - Aviso Legal - Powered by SMF 1.1.21 | SMF © 2006-2008, Simple Machines