Closed karl8solutions closed 3 weeks ago
Hi @karl8solutions, no need for shouting here. Over here https://github.com/sensslen/LibLanc/issues/15 I provided two possible resolutions for your problem. It appears that arduino for avr microcontrollers does not include the stl. Therefore you will need another library that provides stl support to use LibLanc, as it relies on the stl (memory).
As stated before, please have a look at https://github.com/maniacbug/StandardCplusplus. Also make sure you include #include
I'm currently using an esp32 based board with the library which provides stl support out of the box which is why it just works.
Simon,
What Library do I need to download for the #include
K.
Karl Adair | Electronic Engineering Tech.
O: 321 804 8200 | C: 386 320 8629
@.**@.>
[8K Logo Square Small]
From: Simon Ensslen @.> Sent: Wednesday, October 16, 2024 3:04 AM To: sensslen/LibLanc @.> Cc: Karl Adair @.>; Mention @.> Subject: Re: [sensslen/LibLanc] WHICH BOARD TO USE (Issue #16)
I'm currently using an esp32 based board with the library which provides stl support out of the box which is why it just works.
— Reply to this email directly, view it on GitHubhttps://github.com/sensslen/LibLanc/issues/16#issuecomment-2415905765, or unsubscribehttps://github.com/notifications/unsubscribe-auth/APYHQQKHGBOENLEU3P66NSTZ3YFYLAVCNFSM6AAAAABP75Z3XSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDIMJVHEYDKNZWGU. You are receiving this because you were mentioned.Message ID: @.***>
Please read my previous comments.
Sorry I was not yelling just left my caps on by accident. I downloaded the C++ library, thank you for that. Are there any other libraries I need, I included all the avrstl libraries I could, to test if it would work?
Also, how does this look for Lanc Master firmware that would normally come from a camera. Do you have any pointers? Also, when I hook up serial commands to the external video recorders Lanc port, the Arduino stops sending serial until I unplug it again. It freezes but does not lose power.
const int lancPin = 1; //arduino nano tx pin const int bitPeriod = 104; // Bit period in microseconds (9600 baud)
void setup() { pinMode(lancPin, OUTPUT); digitalWrite(lancPin, HIGH); Serial.begin(9600); }
void loop() { if (Serial.available()) { byte command = Serial.read(); sendLancCommand(0x18, command); } }
void sendLancCommand(byte addr, byte command) { byte data[2]; data[0] = addr; data[1] = command; for (int i = 0; i < 2; i++) { sendLancByte(data[i]); } }
void sendLancByte(byte data) { for (int i = 0; i < 8; i++) { if (data & 0x80) { digitalWrite(lancPin, HIGH); } else { digitalWrite(lancPin, LOW); } delayMicroseconds(bitPeriod); data <<= 1; } digitalWrite(lancPin, HIGH); // Stop bit delayMicroseconds(bitPeriod); }
Hi @karl8solutions, I'm sorry to disappoint you. Github is not the right platform for your requests. It seems you are trying to learn how to use Arduino and want to learn by making a project that involves communication with video equipment using the lanc protocol. While LibLanc can solve some of this, you should really first gain a basic understanding on how c/c++ and electronics work.
Feel free to open issues when there is an issue with the library. If you have questions on how to use it, I will try to point you to resources that can help. However I will not review your code and correct it.
I CONFIRMED THAT I CAN UPLOAD EXAMPLES, JUST NOT THIS ONE. WHAT ARDUINO DID YOU USE TO TEST THIS, OR DOES IT NOT MATTER? ALSO, MY IDE KEEPS GIVING A MESSAGE THAT THE LIBRARY NEEDS THE MEMORY TO BE RESOLVED. I AM USING AN ARDUINO NANO. THANKS.