mc-Things

mc-Products => mc-Studio => Topic started by: gaston on August 12, 2016, 04:58:23 pm

Title: Using the Button on mcModule
Post by: gaston on August 12, 2016, 04:58:23 pm
Trying to lear how to use mc-Studio, I am writing a simple program to react to the button being pressed and released.

Code: [Select]
Class MQTT_Button
   
    // The following will test the usage of the button on the McModule
    Shared Event Button0Pressed() // The button have been pressed
       
        LedGreen = True // Set the LedGreen ON
       
    End Event
   
    // The following will test the usage of the button on the McModule
    Shared Event Button0Released() // The button have been released
       
        LedGreen = False // Set the LedGreen OFF
       
    End Event
   
End Class

I am using the build-in event Button0Pressed and Button0Released, mc-Studio is giving me an ertor 'Expected the Priority or Raised Clause'. I do not want to use the Raised clause since this event will be random when the button is pressed, how do I use the Priority Clause?
Title: Re: Using the Button on mcModule
Post by: mc-John on August 12, 2016, 05:19:55 pm
It should be ButtonPressed and ButtonReleased (without the 0)
Title: Re: Using the Button on mcModule
Post by: gaston on August 12, 2016, 06:00:45 pm
Please update the mc-ScriptUserGuide (page 49 and 50)
Title: Re: Using the Button on mcModule
Post by: mc-John on August 13, 2016, 12:39:30 pm
I just did
Title: Re: Using the Button on mcModule
Post by: gaston on August 15, 2016, 04:13:45 pm
Sorry, but I checked in mc-ScriptUserGuide.pdf online and the Butto0Pressed is still there.

Title: Re: Using the Button on mcModule
Post by: mc-John on August 17, 2016, 09:58:52 am
I was not very clear but what I meant to say that I changed it in the version here. It still needs to be published to our web-site.