I was trying to run this library on Arduino Mega, using ESP8266 as replacement of Wifi Shield, as suggested on my older thread.
The problem is, I got error in compiling, after with this code :
#include <WiFiEsp.h>
#include <WiFiEspClient.h>
#include <WiFiEspUdp.h>
#include "AppleMidi.h"
APPLEMIDI_CREATE_INSTANCE(WiFiUDP, appleMIDI1);
....
exit status 1
'WiFiUDP' was not declared in this scope
if I modified the code into this :
#include <WiFiEsp.h>
#include <WiFiUdp.h>
#include "AppleMidi.h"
APPLEMIDI_CREATE_INSTANCE(WiFiUDP, appleMIDI1);
....
I got this error instead
C:\Program Files (x86)\Arduino\libraries\WiFi\src\utility\server_drv.cpp:313:40: error: 'WARN' was not declared in this scope
WARN("error waitResponse isDataSent"); ^
exit status 1
Full code here at pastebin. I was pretty much stuck now. Please help! :(
Thanks :D
-
WiFiUdp.h is part of the WiFi library for the Arduino WiFi Shield. you can't use itJuraj– Juraj ♦2018年09月20日 08:10:47 +00:00Commented Sep 20, 2018 at 8:10
1 Answer 1
the WiFiEsp class for UDP is WiFiEspUDP
#include <WiFiEsp.h>
#include <WiFiEspUdp.h>
#include "AppleMidi.h"
APPLEMIDI_CREATE_INSTANCE(WiFiEspUDP, AppleMIDI);
-
So I would just need to change WiFiUDP to WiFiEspUDP and I'm good to go?Rinaldo Jonathan– Rinaldo Jonathan2018年09月20日 10:57:03 +00:00Commented Sep 20, 2018 at 10:57
-
yes, the macro creates an object with template type
AppleMidi_Class<WiFiEspUDP> AppleMIDI;
2018年09月20日 11:01:10 +00:00Commented Sep 20, 2018 at 11:01 -
gonna test this tonight. if this works, gonna accept it as answer. thanks for helping me once again :DRinaldo Jonathan– Rinaldo Jonathan2018年09月20日 11:19:02 +00:00Commented Sep 20, 2018 at 11:19
-
I used
#include "WiFiEsp.h"
and#include "WiFiEspUdp.h"
instead and it compiled. thanks!Rinaldo Jonathan– Rinaldo Jonathan2018年09月21日 07:16:37 +00:00Commented Sep 21, 2018 at 7:16