'WiFiNINA' does not name a type

Mac OS 14.0
Arduino Uno WiFi rev 2
Arduino IDE 2.2.1

#include <WiFiNINA.h>
#include <WiFiServer.h>
#include <WiFiClient.h>

WiFiNINA socketSerial(0); // Declare a global Serial object, uses Arduino pin 0
WiFiClient wifiClient(clientPort);
WiFiServer wifiServer(serverPort);

void setup() {
  socketSerial.begin(9600);
  socketSerial.println("Bard_Socket.ino");

  void clientConnect();
  void serverConnect();
  void IP_Services();
  bool dataRX();
  void dataTX();
  
  if(firstCycleMarker) firstCycleMarker = false;
}

void loop() {
}

.ino:5:1: error: 'WiFiNINA' does not name a type; did you mean 'WiFiNINA_h'?
WiFiNINA socketSerial(0);

I tried using WiFiNINA_h, but the compiler didn't like that either. I'm trying to make WiFiNINA global so I am not compiling a separate case of WiFiNINA (Server.begin(9600)) for each of six pages.

What am I doing wrong?

You're getting the error because there is no WiFiNINA class in the WiFiNINA library. Search the library source yourself. It doesn't exist.

Based on this line I'm going to guess that this is Bard generated code? if so, using it is what you're doing wrong. It's nonsense.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.