Annunciator scripting

Support for Arduino in combination with Air Manager and Air Player

Moderators: russ, Ralph

Post Reply
Message
Author
BaronD55
Posts: 31
Joined: Tue Jul 21, 2020 3:52 am
Location: 40°S,177°E

Annunciator scripting

#1 Post by BaronD55 »

If I remove the double hyphens from any of these lines of code I get this
ERROR - logic.lua:(line num): unexpected symbol near '<\226>'

Code: Select all

function new_data_callback(mast_batt, parkbrake, alternator1, alternator2, ground_clearance, 
                                starter1, starter2, gear_handle_status, vertical_speed)
end

fs2020_variable_subscribe("ELECTRICAL MASTER BATTERY:1", "Bool", 
                        “BRAKE PARKING INDICATOR”, “Bool”, 
--                        “GENERATOR_ALTERNATOR_1_BUS_VOLTAGE”, “Float”,
--                        "GENERATOR_ALTERNATOR_2_BUS_VOLTAGE", "Float", 
--                        “RADIO HEIGHT”, “Feet”, 
--                        “STARTER1_SET”, “Bool”, 
--                        “STARTER2_SET”, “Bool”,
--                        “GEAR HANDLE POSITION”, “INT”, 
--                       “VERTICAL SPEED", “Feet per second”,
                         new_data_callback)

I can't see <\226> there anywhere!
What am I doing wrong?

User avatar
Ralph
Posts: 7688
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: Annunciator scripting

#2 Post by Ralph »

You're using ” and ". Different quotation marks. I guess that's the problem.

SimPassion
Posts: 5033
Joined: Thu Jul 27, 2017 12:22 am

Re: Annunciator scripting

#3 Post by SimPassion »

The correct one is as follow :

Code: Select all

function new_data_callback(mast_batt, parkbrake, alternator1, alternator2, ground_clearance, 
                                starter1, starter2, gear_handle_status, vertical_speed)
end

fs2020_variable_subscribe("ELECTRICAL MASTER BATTERY:1", "Bool", 
                        "BRAKE PARKING INDICATOR”, "Bool”, 
                       "GENERATOR_ALTERNATOR_1_BUS_VOLTAGE”, "Float”,
                       "GENERATOR_ALTERNATOR_2_BUS_VOLTAGE", "Float", 
                       "RADIO HEIGHT”, "Feet”, 
                       "STARTER1_SET”, "Bool”, 
                       "STARTER2_SET”, "Bool”,
                       "GEAR HANDLE POSITION”, "INT”, 
                      "VERTICAL SPEED", "Feet per second”,
                         new_data_callback)

BaronD55
Posts: 31
Joined: Tue Jul 21, 2020 3:52 am
Location: 40°S,177°E

Re: Annunciator scripting

#4 Post by BaronD55 »

Ralph that fixed it. You have a very keen eye. I have been gazing intently at that script for ages. I never would've spotted it. Well done.

BaronD55
Posts: 31
Joined: Tue Jul 21, 2020 3:52 am
Location: 40°S,177°E

Re: Annunciator scripting

#5 Post by BaronD55 »

SimPassion,

What did you change?

User avatar
jph
Posts: 2684
Joined: Fri Apr 10, 2020 12:50 pm
Location: Somewhere over the rainbow..

Re: Annunciator scripting

#6 Post by jph »

BaronD55 wrote: Tue Sep 26, 2023 8:18 am SimPassion,

What did you change?
The quotation marks " "

I don't even know where you got the ones you used ;)
Joe. CISSP, MSc.

SimPassion
Posts: 5033
Joined: Thu Jul 27, 2017 12:22 am

Re: Annunciator scripting

#7 Post by SimPassion »

jph wrote: Tue Sep 26, 2023 10:22 am
BaronD55 wrote: Tue Sep 26, 2023 8:18 am SimPassion,

What did you change?
The quotation marks " "

I don't even know where you got the ones you used ;)
Good catch Joe 👍
@BaronD55 indeed we need high concentration and increase level of attention while scripting (coding in any case) and this could occur to any of us ;-) the difference between " and “ could then come as an evidence and @Ralph was quick on this 👏

BaronD55
Posts: 31
Joined: Tue Jul 21, 2020 3:52 am
Location: 40°S,177°E

Re: Annunciator scripting

#8 Post by BaronD55 »

@SimPassion Yes indeed.
Good spotting by Ralph.
I never would have noticed.
They were pasted there from an example snippet of code I pasted from the Wiki.
That's a little lesson learned.
Thanks to one and all.

SimPassion
Posts: 5033
Joined: Thu Jul 27, 2017 12:22 am

Re: Annunciator scripting

#9 Post by SimPassion »

Not sure if the Wiki would be involved in this 🤔
I would rather see the "good or bad" ability of browsers and text edit tools to translate chars "on the fly", while pasting ... :)

Post Reply