Main Site Documentation

FEZ Spider: Events are not/delayed raised


#1

Hi,
my FEZ Spider doesn’t raise events, sometimes he does but then only very delayed when I press the button very often. I’ve already replaced the button and the cable with an other one, but this didn’t change anything. What am I doing wrong? I’ve already updated the firmware:
TinyBooter Version: 4.1.6.0
Firmware Version: 4.1.7.0

Thanks :slight_smile:

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerApp1
{
    public partial class Program
    {
        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */
            /**/
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            
            
            // Do one-time tasks here
            Debug.Print("Program Started");
            
        }

       

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            try
            {
                Debug.Print("ButtonPressed");
                button.ToggleLED();               
            }
            catch (Exception e)
            {
                Debug.Print(e.ToString());
            }
        }
    }
}


#2

Welcome to the forum!

Check this reply. You might need to subscribe to both button events for it to to work properly.

http://www.tinyclr.com/forum/21/5148/#/2/msg49106


#3

This didn’t work for me :frowning:
Maybe I need some kind of Button-Patch, but I can’t find a working download-link. Or do I need another SDK-Version? I have v4.1 from this site http://tinyclr.com/forum/12/5117/… Pls help :o

using System;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;

using GT = Gadgeteer;
using GTM = Gadgeteer.Modules;
using Gadgeteer.Modules.GHIElectronics;

namespace GadgeteerApp1
{
    public partial class Program
    {
        void ProgramStarted()
        {
            /******************************************************************************************
            Access modules defined in the designer by typing their name:                            
            
            e.g.  button
                  camera1

            Initialize event handlers here.
            e.g. button.ButtonPressed += new GTM.MSR.Button.ButtonEventHandler(button_ButtonPressed);             
            ***************************************************************************************** */
            /**/
            button.ButtonReleased += new Button.ButtonEventHandler(button_ButtonReleased);
            button.ButtonPressed += new Button.ButtonEventHandler(button_ButtonPressed);
            
            
            
            // Do one-time tasks here
            Debug.Print("Program Started");
            
            
        }

        void button_ButtonReleased(Button sender, Button.ButtonState state)
        {
            
        }
        

        void button_ButtonPressed(Button sender, Button.ButtonState state)
        {
            try
            {
                Debug.Print("Pressed");
                button.ToggleLED();
               
            }
            catch (Exception e)
            {
                Debug.Print(e.ToString());
            }
        }
    }
}


#4

Have you tried the joystick?

New SDK will be online in few days.


#5

@ CokeViper I have the same problem. Same code, same software and firmware versions. (Oct. 7, 2011 version from download page)

After a bit of digging I’ve found that there is a beta SDK here:

http://www.ghielectronics.com/downloads/NETMF/Beta/GHI%20NETMF%20v4.1%20and%20.NET%20Gadgeteer%20Package.zip

This fixes the button pressed/released issue, but has another bug where you must register an event for both pressed and released or you’ll get a different error, but otherwise it look fine if you’re just getting started, the camera demo works fine so should tide me over for a few days until the next full release version of the SDK is released.

@ GHI Guy’s two bugs in a button class so you can’t even get through the ‘Getting Started’ guide, quite impressive :o


#6

Happy holidays to you too!


#7

Bah! Humbug! :slight_smile:

Spoiled my first impressions of the spider though.


#8

You are using beta software. You may want to wait till non-beta SDK is out please. Another option is to get the button driver sources from codeplex and fix the code. We welcome contributions on open source code, that we are giving and maintaining for free :slight_smile:

Sorry about your troubles and happy holidays.


#9

PS: SDK will be out in few days.


#10

@ Perfectphase Thank you, now it works ;D


#11

Having the same exact problems, please link me to the new SDK as soon as it is out. This is really making me frustrated.


#12

@ bromod Did you try the beta software linked above? It seems to be fixing the problem for others?


#13

@ bromod if you don’t want to install the beta SDK, copy the code from http://codepaste.net/rzixqp and put it in a file in your project and it will be used instead of the one in the SDK, it fixes both the issues above.