Ecuador
Asked — Edited
Resolved Resolved by DJ Sures!

Help With Examples C# Does Not Work?

Hi, I am coding in C# for my new robot of star wars, I have done the code of my Kinect and now I need to implement this code to EZ SDK but I have this Error.. Can someone help me?

User-inserted image

(I have the last SDK)


ARC Pro

Upgrade to ARC Pro

With Synthiam ARC Pro, you're not just programming a robot; you're shaping the future of automation, one innovative idea at a time.

Ecuador
#1  

Sorry It was my problem, I was debugging in x64... and we should debug in x32 :)

PRO
Synthiam
#2  

The readme always helps :)

Ecuador
#3  

yep:( is the second time...

But now I really need help, I am using the example of the Voice Controller Cookie Monster only to test my Ez-B, but when I connect my Ezb to the program I have a problem, Ezb is only connected for 1 minute or less (I can send commands to Ezb) and after that the led of ezb Bluetooth appear connected but the another led starts flashing :(

I have not change anything from the example, but in ARC EZB works well without problems.

I can not use the other examples because I am using WPF (Windows Presentation Fundation) instead Windows Forms and in the other examples you use another form to connect to EZ-B that only works in Windos Forms.

Please if someone knows how to solve this problem, help me. @DJ? Can you help me?

Ecuador
#4  

Ok I have resolved that problem again:) if someone wants to know how here is my code :)


public partial class MainWindow : Window
    {
        KinectSensor _sensor;
        Vector2 handPosition = new Vector2();
        Form1 conecta = new Form1(); ///here I am connecting 1 WPF and 1 Windows Form because the connection of SDK of EZrobot in windows forms works well. 

        public MainWindow()
        {
            InitializeComponent();


        }
        const float MaxDepthDistance = 4000;
        const float MinDepthDistance = 850;
        const float MaxDepthDistanceOffset = MaxDepthDistance - MinDepthDistance;


      
    
  
        public void Window_Loaded(object sender, RoutedEventArgs e)
        {
            conecta.Show(); /// here I am opening the connection windows form




        public void conecta1(object sender, RoutedEventArgs e) ///here I am using the data connection of the second windows form
        {
            EZB _ezb1 = conecta._ezb;
        }

public void button1_Click(object sender, RoutedEventArgs e)
        {
            conecta._ezb.Servo.SetServoPosition(Servo.ServoPortEnum.D10, 50); ///here I can send commands to EZ Board!
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            conecta._ezb.Servo.SetServoPosition(Servo.ServoPortEnum.D10, 10);
        }



If someone do not understad what I am doing tell me! I will try to explain better :)