cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC™ 5, 3 & 1

Anonymous
Not applicable

 Hi, I'm trying to use the ActiveX control in C# to create the bridge between the app and programmer. I imported the control and pasted this code in from the document: http://www.cypress.com/?docID=22268

   
   

It's giving me a warning about the namespace "USB2IICcom_EXEClass" and saying it cannot be found. Any ideas on why this won't work?

   
   


   

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.Diagnostics;

   
   

using USB2IIC;

   
   

 

   
   

namespace WindowsFormsApplication1

   
   

{

   
   

    public partial class Form1 : Form

   
   

    {

   
   

        USB2IICcom_EXEClass Bridge;

   
   

        public Form1()

   
   

        {

   
   

            InitializeComponent();

   
   

        }

   
   

        private void buttonConnect_Click(object sender, EventArgs e)

   
   

        {

   
   

            if (Bridge != null) return; // Bridge is already connected

   
   

            // Create Bridge Instance

   
   

            Bridge = new USB2IICcom_EXEClass();

   
   

            // Connect Events

   
   

            Bridge.BridgeConnected = OnBridgeConnect;

   
   

            Bridge.BridgeDisconnected = OnBridgeDisconnect;

   
   

            // Start USB Communication

   
   

            Bridge.InitUSB2IIC(Process.GetCurrentProcess().Id);

   
   

        }

   
   

        private void buttonDisconnect_Click(object sender, EventArgs e)

   
   

        {

   
   

            Bridge = null;

   
   

            GC.GetTotalMemory(true);

   
   

        }

   
   

        private void OnBridgeConnect(string BridgeID, string str)

   
   

        {

   
   

            MessageBox.Show("Connected: " BridgeID);

   
   

        }

   
   

        private void OnBridgeDisconnect(string BridgeID)

   
   

        {

   
   

            MessageBox.Show("Disconnected: " BridgeID);

   
   

        }

   
   

    }

   
   

}

   
   

 

   
0 Likes
1 Reply
Anonymous
Not applicable

 I got a version of this to run using the files on this page: http://www.cypress.com/?id=3&rtID=5&rID=47&fileID=265&cache=0&CFID=43384&CFTOKEN=43181305#

   

I tried the Visual Basic example and the C# example. Each one allows a connection, but no devices show up. I have the programmer plugged into the USB port on my computer and the status light shows green. Any ideas on what could be the problem?

0 Likes