Arduino Uno Wifi Rev.2 verbindet sich nicht mit dem Internet?

Ich versuche meinen Arduino Uno Wifi Rev.2 mit dem WLAN zu verbinden. Der Code (Beispiel Code WiFi Nina ConnectWithWPA) lässt sich kompilieren und hochladen, keine Fehlermeldung. Alle "Werte" (Passwort, SSID) stimmen. Der Arduino hat die neuste Firmware. Wenn das Programm dann aber hochgeladen ist, entsteht eine Endlosschleife, in der der Arduino immer wieder "Attempting to connect to WPA SSID: XXXXXX" ausgibt, er sich aber nicht mit dem WLAN verbindet, da er sonst "You´re connected with the network" ausgeben würde.

Danke schonmal für eure Hilfe

Mein Code:
/*
 This example connects to an unencrypted WiFi network.
 Then it prints the MAC address of the WiFi module,
 the IP address obtained, and other network details.


 created 13 July 2010
 by dlf (Metodo2 srl)
 modified 31 May 2012
 by Tom Igoe
 */
#include <SPI.h>
#include <WiFiNINA.h>


#include "arduino_secrets.h" 
///////please enter your sensitive data in the Secret tab/arduino_secrets.h
char ssid[] = SECRET_SSID;        // your network SSID (name)
char pass[] = SECRET_PASS;    // your network password (use for WPA, or use as key for WEP)
int status = WL_IDLE_STATUS;     // the WiFi radio's status


void setup() {
  //Initialize serial and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for native USB port only
  }


  // check for the WiFi module:
  if (WiFi.status() == WL_NO_MODULE) {
    Serial.println("Communication with WiFi module failed!");
    // don't continue
    while (true);
  }


  String fv = WiFi.firmwareVersion();
  if (fv < WIFI_FIRMWARE_LATEST_VERSION) {
    Serial.println("Please upgrade the firmware");
  }


  // attempt to connect to WiFi network:
  while (status != WL_CONNECTED) {
    Serial.print("Attempting to connect to WPA SSID: ");
    Serial.println(ssid);
    // Connect to WPA/WPA2 network:
    status = WiFi.begin(ssid, pass);


    // wait 10 seconds for connection:
    delay(10000);
  }


  // you're connected now, so print out the data:
  Serial.print("You're connected to the network");
  printCurrentNet();
  printWifiData();


}


void loop() {
  // check the network connection once every 10 seconds:
  delay(10000);
  printCurrentNet();
}


void printWifiData() {
  // print your board's IP address:
  IPAddress ip = WiFi.localIP();
  Serial.print("IP Address: ");
  Serial.println(ip);
  Serial.println(ip);


  // print your MAC address:
  byte mac[6];
  WiFi.macAddress(mac);
  Serial.print("MAC address: ");
  printMacAddress(mac);
}


void printCurrentNet() {
  // print the SSID of the network you're attached to:
  Serial.print("SSID: ");
  Serial.println(WiFi.SSID());


  // print the MAC address of the router you're attached to:
  byte bssid[6];
  WiFi.BSSID(bssid);
  Serial.print("BSSID: ");
  printMacAddress(bssid);


  // print the received signal strength:
  long rssi = WiFi.RSSI();
  Serial.print("signal strength (RSSI):");
  Serial.println(rssi);


  // print the encryption type:
  byte encryption = WiFi.encryptionType();
  Serial.print("Encryption Type:");
  Serial.println(encryption, HEX);
  Serial.println();
}


void printMacAddress(byte mac[]) {
  for (int i = 5; i >= 0; i--) {
    if (mac[i] < 16) {
      Serial.print("0");
    }
    Serial.print(mac[i], HEX);
    if (i > 0) {
      Serial.print(":");
    }
  }
  Serial.println();
}
WLAN, Arduino, C (Programmiersprache)
Arduino Code funktioniert nicht?

IRremote und JoyStick funktionieren nicht

#include <SPI.h> // Bibliothek für SPI-Kommunikation

#include <Mirf.h> // Bibliothek für nRF24L01

#include <nRF24L01.h> // Treiber für nRF24L01

#include <MirfHardwareSpiDriver.h> // Hardware-SPI-Treiber für Mirf

#include <IRremote.h> // Bibliothek für IR-Kommunikation

// Pin-Definitionen

int receiver = 4; // Pin für den IR-Empfänger

const int SW = 2; // Pin für den Schalter

const int X = A0; // Analog-Pin für X-Achse

const int Y = A1; // Analog-Pin für Y-Achse

// Initialisierung des IR-Empfängers

IRrecv irrecv(receiver);

IRsend results;

uint32_t last_decodedRawData = 0; // Variable zum Speichern des letzten IR-Codes

// Funktion zur Verarbeitung des empfangenen IR-Codes

void translateIR() {

 if (irrecv.decodedIRData.flags) {

  // Wenn ein Wiederholungscode empfangen wird, den letzten empfangenen Code verwenden

  irrecv.decodedIRData.decodedRawData = last_decodedRawData;

 } else {

  // Den empfangenen Code im seriellen Monitor ausgeben

  Serial.print("Empfangener IR-Code: 0x");

  Serial.println(irrecv.decodedIRData.decodedRawData, HEX);

 }

}

// Setup-Funktion, die einmal beim Starten des Programms ausgeführt wird

void setup() {

 Serial.begin(9600); // Startet die serielle Kommunikation mit 9600 Baud

 irrecv.enableIRIn(); // Aktiviert den IR-Empfänger

 pinMode(SW, INPUT); // Setzt den Schalter-Pin als Eingang

 digitalWrite(SW, HIGH); // Aktiviert den Pull-up-Widerstand für den Schalter

 Mirf.cePin = 9; // Setzt den Chip Enable (CE) Pin für den nRF24L01

 Mirf.csnPin = 10; // Setzt den Chip Select Not (CSN) Pin für den nRF24L01

 Mirf.spi = &MirfHardwareSpi; // Setzt den SPI-Treiber für Mirf

 Mirf.init(); // Initialisiert den nRF24L01

 Mirf.setRADDR((byte *)"Sen01"); // Setzt die Adresse des Senders

 Mirf.payload = sizeof(unsigned int); // Setzt die Payload-Größe auf die Größe eines unsigned int

 Mirf.channel = 3; // Setzt den Kommunikationskanal auf 3

 Mirf.config(); // Konfiguriert den nRF24L01

}

unsigned int adata = 0; // Variable zum Speichern der zu sendenden Daten

// Hauptschleife, die kontinuierlich ausgeführt wird

void loop() {

 // Überprüfen, ob ein IR-Signal empfangen wurde

 if (irrecv.decode()) {

  translateIR(); // Verarbeitung des empfangenen IR-Codes

  irrecv.resume(); // Bereit zum Empfang des nächsten IR-Codes

 }

 // Lesen des Schalter- und Analogwerte

 int swValue = digitalRead(SW); // Lesen des Schalterzustands

 int xValue = analogRead(X); // Lesen des X-Achsen-Werts

 int yValue = analogRead(Y); // Lesen des Y-Achsen-Werts

 // Überprüfen der empfangenen IR-Codes und Setzen von adata entsprechend

 if (last_decodedRawData == 0xAD52FF00) {

  adata = 12006;

 } else if (last_decodedRawData == 0xBF40FF00) {

  adata = 12005;

 } else if (last_decodedRawData == 0xBC43FF00) {

  adata = 12004;

 } else if (last_decodedRawData == 0xBB44FF00) {

  adata = 12003;

 }

 // Überprüfen des Schalterwerts und Setzen von adata

 if (swValue == 0) {

  adata = 2103;

 }

 // Überprüfen der Analogwerte und Setzen von adata

 if (yValue < 1024 && yValue > 6 && xValue > 150 && xValue < 800) {

  adata = 213;

 } else if (yValue < 512 && yValue > -1 && xValue > 200 && xValue < 700) {

  adata = 312;

 } else if (xValue < 509 && xValue > -1 && yValue > 200 && yValue < 750) {

  adata = 231;

 } else if (xValue < 1024 && xValue > 515 && yValue > 450 && yValue < 750) {

  adata = 321;

 } else if (xValue < 514 && xValue > 510 && yValue < 511 && yValue > 507) {

  adata = 123;

 }

 // Senden der Daten über Mirf, wenn adata gesetzt wurde

 if (adata != 0) {

  byte data[Mirf.payload]; // Array zum Speichern der zu sendenden Daten

  data[0] = adata & 0xFF; // Niedriges Byte von adata

  data[1] = adata >> 8; // Hohes Byte von adata

  Mirf.setTADDR((byte *)"Rec01"); // Setzt die Adresse des Empfängers

  Mirf.send(data); // Sendet die Daten

  while (Mirf.isSending()) {} // Warten, bis das Senden abgeschlossen ist

  delay(20); // Kurze Pause, um das Senden zu beenden

  adata = 0; // Zurücksetzen von adata nach dem Senden

 }

}

Arduino, Code, Programmiersprache, Arduino Uno, Arduino IDE
Arduino 32 Segment Display Counter programmieren?

Hi,

wie kann ich bei einem Arduino 32 Segment Display einen Counter programmieren der von 9 auf 0 runter geht? Ich habe mir zuerst dieses Standart BSP von `Hello World `: Das ist der Script:

/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.
The circuit:
* LCD RS pin to digital pin 12
* LCD Enable pin to digital pin 11
* LCD D4 pin to digital pin 5
* LCD D5 pin to digital pin 4
* LCD D6 pin to digital pin 3
* LCD D7 pin to digital pin 2
* LCD R/W pin to ground
* LCD VSS pin to ground
* LCD VCC pin to 5V
* 10K resistor:
* ends to +5V and ground
* wiper to LCD VO pin (pin 3)
Library originally added 18 Apr 2008
by David A. Mellis
library modified 5 Jul 2009
by Limor Fried (http://www.ladyada.net)
example added 9 Jul 2009
by Tom Igoe
modified 22 Nov 2010
by Tom Igoe
modified 7 Nov 2016
by Arturo Guadalupi
This example code is in the public domain.
http://www.arduino.cc/en/Tutorial/LiquidCrystalHelloWorld
*/
// include the library code:
#include <LiquidCrystal.h>
// initialize the library by associating any needed LCD interface pin
// with the arduino pin number it is connected to
const int rs = 12, en = 11, d4 = 5, d5 = 4, d6 = 3, d7 = 2;
LiquidCrystal lcd(rs, en, d4, d5, d6, d7);
void setup() {
// set up the LCD's number of columns and rows:
lcd.begin(16, 2);
// Print a message to the LCD.
lcd.print("Motor startet in:");
}
void loop() {
// set the cursor to column 0, line 1
// (note: line 1 is the second row, since counting begins with 0):
lcd.setCursor(8,2);
// print the number of seconds since reset:
lcd.print(millis() / 1000);
}

Danke im voraus :-).

programmieren, Arduino, Arduino Uno

Meistgelesene Beiträge zum Thema Arduino