Author Topic: Using the Button on mcModule  (Read 445 times)

gaston

  • Newbie
  • *
  • Posts: 26
    • View Profile
Using the Button on mcModule
« 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?

Share on Facebook Share on Twitter


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Using the Button on mcModule
« Reply #1 on: August 12, 2016, 05:19:55 pm »
It should be ButtonPressed and ButtonReleased (without the 0)

gaston

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Using the Button on mcModule
« Reply #2 on: August 12, 2016, 06:00:45 pm »
Please update the mc-ScriptUserGuide (page 49 and 50)

mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Using the Button on mcModule
« Reply #3 on: August 13, 2016, 12:39:30 pm »
I just did

gaston

  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: Using the Button on mcModule
« Reply #4 on: August 15, 2016, 04:13:45 pm »
Sorry, but I checked in mc-ScriptUserGuide.pdf online and the Butto0Pressed is still there.


mc-John

  • Global Moderator
  • Full Member
  • *****
  • Posts: 212
    • View Profile
Re: Using the Button on mcModule
« Reply #5 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.