Main Site Documentation

Mountaineer buton event not fired with fash module


#1

Hi

In my project i used a Flash module. When i pressed the button buttonForMountaineer_ButtonPressed event working only one time.
And button events not work until i reset the board.


using System;
using System.Collections;
using System.Threading;
using System.Text;
using Microsoft.SPOT;
using Microsoft.SPOT.Presentation;
using Microsoft.SPOT.Presentation.Controls;
using Microsoft.SPOT.Presentation.Media;
using Microsoft.SPOT.Touch;

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

namespace mnt_test
{
    public partial class Program
    {
        byte[] bytes2;
        static byte[] RX_buffer = new byte[50];
        void ProgramStarted()
        {
            buttonForMountaineer.ButtonPressed += new ButtonForMountaineer.ButtonEventHandler(buttonForMountaineer_ButtonPressed);
            buttonForMountaineer.ButtonReleased += new ButtonForMountaineer.ButtonEventHandler(buttonForMountaineer_ButtonReleased);
            Debug.Print("Program Started");
        }
               
        private void buttonForMountaineer_ButtonPressed(ButtonForMountaineer sender, ButtonForMountaineer.ButtonState value)
        {
            Debug.Print("Button pressed!");
            bytes2 = flash.ReadData(0, 27);
            string settings2 = new string(Encoding.UTF8.GetChars(bytes2));
        }
        private void buttonForMountaineer_ButtonReleased(ButtonForMountaineer sender, ButtonForMountaineer.ButtonState value)
        {
            Debug.Print("Button released!");
        }        
    }
}



#2

@ kucukkose - Could this be related to the bug discussed here?

https://www.ghielectronics.com/community/forum/topic?id=12432&page=1

If so, it should be corrected with the 4.3 release. If Microsoft is ready by then with its final 4.3 release of the Gadgeteer Core, we should be able to publish it in August.

Cuno


#3

Thank you so much.