Arduino limitations. Can this be done?
Arduino limitations. Can this be done?
I have seen the arduino API, and while it is good (really good for standard builders... switches, buttons, leds, encoders...) is far from what arduino can do ( SPI and I2C support.. custom librarys... )
I am not asking to implement complex things in the air manager API.
But.. If you could add a way to use serial comunication... we could send data from the this main arduino to other/others. And use the others with the arduino standard api for complex systems.
I think it would convert Air Manager into the best cockpit builder environment (software and hardware) I can imagine.
Arturo.
I am not asking to implement complex things in the air manager API.
But.. If you could add a way to use serial comunication... we could send data from the this main arduino to other/others. And use the others with the arduino standard api for complex systems.
I think it would convert Air Manager into the best cockpit builder environment (software and hardware) I can imagine.
Arturo.
Re: Arduino limitations. Can this be done?
Hi,
You are right, we don't support stuff like SPI and i2C on the Arduino. The main reason is because we want the system to be simple as possible.
Adding stuff like SPI would make the instrument lua code more 'technical', something we always try to prevent.
It would be cool though to have more control over your Arduino. I am thinking of making an Air Manager library for Arduino. It should add a way to send 'generic' messages between the Arduino and Air Manager. That way you can create your own Arduino program and have full control on what it should do while having a communication path with Air Manager.
But, you are the first one to request something like this, so don't expect us to start working on this immediately. We are kinda packed the coming year
Corjan
You are right, we don't support stuff like SPI and i2C on the Arduino. The main reason is because we want the system to be simple as possible.
Adding stuff like SPI would make the instrument lua code more 'technical', something we always try to prevent.
It would be cool though to have more control over your Arduino. I am thinking of making an Air Manager library for Arduino. It should add a way to send 'generic' messages between the Arduino and Air Manager. That way you can create your own Arduino program and have full control on what it should do while having a communication path with Air Manager.
But, you are the first one to request something like this, so don't expect us to start working on this immediately. We are kinda packed the coming year
Corjan
Re: Arduino limitations. Can this be done?
This sounds perfect to me.Corjan wrote: ↑Wed Dec 06, 2017 5:06 pm I am thinking of making an Air Manager library for Arduino. It should add a way to send 'generic' messages between the Arduino and Air Manager. That way you can create your own Arduino program and have full control on what it should do while having a communication path with Air Manager.
So, I just have to persuade some thousands of people to ask for the same
Thanks for the quick response.
Arturo.
Re: Arduino limitations. Can this be done?
Haha, yes Let me know when you find them
Corjan
Corjan
-
- Posts: 32
- Joined: Sun Feb 12, 2017 7:55 pm
Re: Arduino limitations. Can this be done?
Good job, you've persuade me.
After New Years, I'll start getting back into AM3 & Arduinos.
What I want to do is fairly simple - Interface LEDs and servomotors with P3d V4.
Buttons, switches, and encoders are super simple though.
Thanks everybody for some great software.
Re: Arduino limitations. Can this be done?
LED's and servo's can easily be done with our API. Nothing special needed for that
Re: Arduino limitations. Can this be done?
I went ahead and implemented it anyways
There will be a bidirectional way to communicate between the instrument and the Arduino.
Every message has it's own 16bit ID, and a variable payload of 0 - 8 bytes can be attached.
Arduino side:
Instrument side:
This will be included in the next AM 3.1 BETA.
Corjan
There will be a bidirectional way to communicate between the instrument and the Arduino.
Every message has it's own 16bit ID, and a variable payload of 0 - 8 bytes can be attached.
Arduino side:
Code: Select all
#include <si_message_port.h>
static void new_message_callback(uint16_t message_id, uint8_t* data, uint8_t len) {
// We received a message from Air Manager or Air Player
// data argument is only valid during the execution of this function
// Clone the data if you wish to retain it.
// Send a message back to Air Manager or Air Player
uint8_t data[3] = { 0x00, 0x09, 0xAA };
if (si_message_port_send(777, data, 3) == SI_MESSAGE_PORT_RESULT_OK) {
// Message is on it's way!
}
else {
// Something went wrong sending our message
}
}
void setup() {
// Initialize on channel A
si_message_port_init(SI_MESSAGE_PORT_CHANNEL_A, new_message_callback);
}
void loop() {
// Make sure this function is called regularly
si_message_port_tick();
}
Code: Select all
-- This function will be called when a message is received from the Arduino.
function new_message(id, payload)
print("received new message with id " .. id)
end
id = hw_message_port_add("ARDUINO_MEGA2560_A", new_message)
-- You can also send messages to the Arduino
-- In this case a message with id 777 with 3 bytes (0x01, 0x02, 0x03)
hw_message_port_send(id, 777, [ 1, 2, 3 ])
Corjan
Re: Arduino limitations. Can this be done?
Cool!
Thanks.
Thanks.
Re: Arduino limitations. Can this be done?
Hi,
First release of the library is finished, more information here:
https://siminnovations.com/wiki/index.php?title=Arduino
The latest Air Manager BETA is compatible with this library:
https://siminnovations.com/wiki/index.p ... sktop_BETA
Corjan
First release of the library is finished, more information here:
https://siminnovations.com/wiki/index.php?title=Arduino
The latest Air Manager BETA is compatible with this library:
https://siminnovations.com/wiki/index.p ... sktop_BETA
Corjan
Re: Arduino limitations. Can this be done?
So... please forgive the stupid question... I have zero experience with Arduino.
Is the idea to interface Arduino with Air Manager INSTEAD OF directly with P3Dv4? I use FSUIPC within P3Dv4. I believe FSUIPC supports the interface of additional hardware devices (including Arduino controlled devices) on my main P3Dv4 PC. Is the point here to add those additional devices to a networked PC and talking to P3Dv4 through Air Manager?
Thanks.
Scott
Is the idea to interface Arduino with Air Manager INSTEAD OF directly with P3Dv4? I use FSUIPC within P3Dv4. I believe FSUIPC supports the interface of additional hardware devices (including Arduino controlled devices) on my main P3Dv4 PC. Is the point here to add those additional devices to a networked PC and talking to P3Dv4 through Air Manager?
Thanks.
Scott