Probably a noob question but I’m hitting a wall as I follow the device quickstart guide. Running an Arduino Uno over USB using the stock IDE.
Unfortunately the code given in the quickstart is not even compiling for me. Can’t help but feel like something’s missing but I’m copying it verbatim and it’s throwing errors. Library is installed in the right place, picked right board in the IDE, etc. Here is the code from the quickstart;
C:\Users\xxxx\AppData\Local\Temp\ccnPOoqf.ltrans0.ltrans.o: In function `main':
C:\Users\xxxx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:43: undefined reference to `setup'
C:\Users\xxxx\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.5\cores\arduino/main.cpp:46: undefined reference to `loop'
collect2.exe: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino Uno.
Seems like something obvious but just confusing because I’m following the guide exactly.
Take a look at the image, if you click here it will take you to the examples, choose an example, board, and connection method then upload it to your board.
I’m now trying one of the examples filled in with my device info. It compiles now but still no connection in the quickstart.
Still using Arduino Uno over USB via the Blynk web console.
#define BLYNK_TEMPLATE_ID "TMPLhcdxFzyC"
#define BLYNK_DEVICE_NAME "Quickstart Device"
#define BLYNK_AUTH_TOKEN "xxxxx"
/* Comment this out to disable prints and save space */
#define BLYNK_PRINT DebugSerial
/* Fill-in your Template ID (only if using Blynk.Cloud) */
// #define BLYNK_TEMPLATE_ID "TMPLhcdxFzyC"
// You could use a spare Hardware Serial on boards that have it (like Mega)
#include <SoftwareSerial.h>
SoftwareSerial DebugSerial(2, 3); // RX, TX
#include <BlynkSimpleStream.h>
// You should get Auth Token in the Blynk App.
// Go to the Project Settings (nut icon).
char auth[] = "xxxxx";
void setup()
{
// Debug console
DebugSerial.begin(9600);
// Blynk will work through Serial
// Do not read or write this serial manually in your sketch
Serial.begin(9600);
Blynk.begin(Serial, auth);
}
void loop()
{
Blynk.run();
}