I am a complete newbe when it comes to arduino and AM3.3
I have tried to get the example from Ralph (on board led on pin 13) with no success
When I paste the code into my script and run it I get this:
This is the code:ERROR - [string "logic.lua"]:27: Argument 'hw_id(1)' in function 'hw_led_add' is nil, which is not allowed
ERROR - [string "logic.lua"]:31: Argument 'id(1)' in function 'hw_led_set' is nil, which is not allowed
Code: Select all
my_led = hw_led_add(ARDUINO_MEGA2560_A_D13, 1.0)
function new_data(brightness)
hw_led_set(my_led, brightness)
end
xpl_dataref_subscribe("sim/cockpit/radios/transponder_brightness", "FLOAT", new_data) --brightness
This is the code:ERROR - [string "logic.lua"]:47: Argument 'hw_id(1)' in function 'hw_button_add' is nil, which is not allowed
Code: Select all
function button_pressed()
print("button pressed")
end
--function button_released()
--print("button released")
--end
hw_button_add(ARDUINO_MEGA2560_A_D9, button_pressed)
Is it not necessary to tell the arduino what is on pin 9 and that pin 9 in for INPUT and that I want to use the on board pull-up
Have fun
Jedeen