I am working with Particle Argon and a relay. When I connect the VCC of the relay to VUSB of the Argon the relay get pulled to LOW and does not response to the digital pins even though I digitalWrite HIGH to the connected pin. The issue appear immediately when I power the Argon and before it gets connected to the cloud. The same issue also appeared when I tried it with a newly unpacked Argon.
If you are running your code without SYSTEM_THREAD(ENABLED) and without SYSTEM_MODE(SEMI_AUTOMATIC) or SYSTEM_MODE(MANUAL) your program will not run until the cloud connection is established, hence your digitalWrite() will not be executed until then.
You also need to have common ground between your relay and the Argon.
If you read the response from @ScruffR carefully, I believe he IS suggesting you add SYSTEM_THREAD(ENABLED) to your Code.
WIth System_Thread enabled, the Argon can perform your DigitalWrite HIGH (and other actions) while it’s also busy establishing the Cloud Connection…instead of waiting for the Cloud connection to complete before executing your Code.