okeefe
July 28, 2019, 11:21pm
1
Im attempting to use an external mesh antenna on one of my Argon & Xenons, is it correct that all I need to do is add this function to my code and call the function in my setup?
void selectExternalMeshAntenna() {
#if (PLATFORM_ID == PLATFORM_ARGON)
digitalWrite(ANTSW1, 1);
digitalWrite(ANTSW2, 0);
#elif (PLATFORM_ID == PLATFORM_BORON)
digitalWrite(ANTSW1, 0);
#else
digitalWrite(ANTSW1, 0);
digitalWrite(ANTSW2, 1);
#endif
}
** it did seem to work code wise, but I didnt get any extra range from what I could tell (across the house connection)
RWB
July 29, 2019, 5:43am
2
Yes and it does work.
Enable system threading at the top of your sketch, that’s what I did. Not sure if it’s required.
That code tripled the BLE range on a Xenon, same for the MESH.
okeefe
July 30, 2019, 4:10pm
3
I included system threading and added antennas to both sides (on argon and xenon). Things are much happier. TYVM for the help!
1 Like
armor
July 30, 2019, 4:34pm
4
If you feel that your request/issue is solved can you tick the Solution box?
1 Like
jwheasi
September 1, 2019, 12:43am
5
I have successfully used this code to increase the performance of my Argon to Xenon mesh network communications.
I have a basic coding question however that I can’t seem to figure out with google or the docs.
Why is there a # symbol in front of the IF statement blocks, and why is the else if, shortened to eleif.
What is special about the use of the symbol?
TIA
John
jwheasi:
I have a basic coding question however that I can’t seem to figure out with google or the docs.
Why is there a # symbol in front of the IF statement blocks, and why is the else if, shortened to eleif.
What is special about the use of the symbol?
When a # symbol is in front it’s a preprocessor directive.
http://www.cplusplus.com/doc/tutorial/preprocessor/
It’s a standard C/C++ feature not exclusive to Particle.
jwheasi
September 1, 2019, 2:14am
7
Thanks! I thought it would be a C/C++ thing, but couldn’t get close enough for google to help me out.
1 Like