Ich bin hier neu und wollte etwas von euch wissen (habe es aber selber hin bekommen ), Hier ein kleines Programm zu m ES32 mini ,it Neopixel 60 und LDR

#include <WiFi.h>
#include <Adafruit_NeoPixel.h>


#define NTP_SERVER "de.pool.ntp.org"
#define TZ_INFO "WEST-1DWEST-2,M3.5.0/02:00:00,M10.5.0/03:00:00" // Western European Time
#define NEOPIN 26       // Pin Neopixel
#define STARTPIXEL 29   // Start verschoben von 0
#define NEOLED 60       // Anzahl LED´s
#define sync1 3         // Sync 3 Uhr
#define sync2 15        // Sync 15 Uhr
#define LDR A0          // LDR Sensor
#define DAYBRIGHTNESS 80    // Helligkeit Tag   ( bei LDR egal)
#define NIGHTBRIGHTNESS 20  // Helligkeit Nacht ( bei LDR egal)



RTC_DATA_ATTR int bootZaeler = 0;   // Variable in RTC Speicher bleibt erhalten nach Reset
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NEOLED, NEOPIN, NEO_GRB + NEO_KHZ800); // strip object

const char* ssid = "************";
const char* password = "***************";

byte pixelColorRed, pixelColorGreen, pixelColorBlue; // holds color values
byte secondval;
byte minuteval;
int hourval;
int sensorValue;
int LDR_Wert = 0;
int Licht;
int Dimmer = 90;
boolean sync = 0;
boolean LDR_ONOFF = 0;


struct tm local;


void setup()   
{    
  Serial.begin(115200);
  delay(200);
  Serial.println();
  Serial.println("Init");
  pinMode(NEOPIN, OUTPUT);
  LDR_Test();
  strip.begin();
  if (LDR_ONOFF == true)
  {
    Licht_Dimmer();
    strip.setBrightness(Dimmer); // set brightness
    strip.show();
  }
  else
  {
    strip.setBrightness(DAYBRIGHTNESS); // set brightness
    strip.show();
  }
  SyncNTP();
  sync = 0;
  delay(500);
}


// Fill the dots one after the other with a color
void colorWipe(uint32_t c, uint8_t wait) {
  for (uint16_t i = 0; i < strip.numPixels(); i++)
  {
    //strip.setPixelColor(i, c);
    strip.setPixelColor((i + STARTPIXEL) % 60, c);
    strip.show();
    delay(wait);
  }
}

void LDR_Test()
{
  sensorValue = analogRead(LDR); // read analog input pin 
  if (sensorValue < 3000)
    LDR_ONOFF = 1;
  else
    LDR_ONOFF = 0;
}

void LDR_wert()
{
  sensorValue = analogRead(LDR); // read analog input pin 0
  Licht = sensorValue;
}


void Licht_Dimmer()
{
  LDR_wert();
  if (Licht < 300)
    Dimmer = 15;
  if (Licht > 600)
    Dimmer = 40;
  if (Licht > 900)
    Dimmer = 80;
}


void Wifi_onoff(boolean stat)
{
  if ( stat == true )
  {
      Serial.println();
      Serial.print("Connecting ");
      Serial.print(ssid);
      Serial.print(" ");
      WiFi.begin(ssid, password);
      while (WiFi.status() != WL_CONNECTED)
      {
        Serial.print(".");
        delay(200);
      }
      Serial.println();
      Serial.println("WiFi connected.");
      Serial.println();
      Serial.print("IP address: ");
      Serial.println(WiFi.localIP());
      Serial.println();
  }
  else
  {
    WiFi.mode( WIFI_MODE_NULL);
  }
}

boolean NTPTest()
{
  if (local.tm_year < 121)
  {
    colorWipe(strip.Color(208, 32, 144), 20);
    colorWipe(strip.Color(0, 0, 0), 20);
    return(false);
  }
  else
    return(true);
}

void  SyncNTP()
{
  if (sync == 0)
  {
    Wifi_onoff(true);
    getLocalTime(&local);
    configTzTime(TZ_INFO, NTP_SERVER); // ESP32 Systemzeit mit NTP Synchronisieren
    Serial.println("Timesync");
    do
      getLocalTime(&local, 10000);      // Versuche 10 s zu Synchronisieren
    while (NTPTest() == false);
    Serial.println(&local, "Datum: %d.%m.%y  Zeit: %H:%M:%S"); // Zeit Datum Print Ausgabe formatieren
    Serial.println("--------------------------------");
    colorWipe(strip.Color(255, 0, 0), 20); // Red
    colorWipe(strip.Color(0, 255, 0), 20); // Green
    colorWipe(strip.Color(0, 0, 255), 20); // Blue
    colorWipe(strip.Color(0, 0, 0), 20); // off
    delay(100);
    sync = 1;
    Wifi_onoff(false);
  }
}


void NTPSync()
{
  if ((hourval == sync1) and (secondval == 0) and (minuteval == 5) and (sync == 0))
    SyncNTP();    
  if ((hourval == sync1) and (secondval == 0) and (minuteval == 6) and (sync == 1))
    sync = 0;
  if ((hourval == sync2) and (secondval == 0) and (minuteval == 0) and (sync == 0))
    SyncNTP();    
  if ((hourval == sync2) and (secondval == 0) and (minuteval == 1) and (sync == 1))
    sync = 0;
}

void Zeitum()
{
  getLocalTime(&local);
  secondval = local.tm_sec;
  minuteval = local.tm_min;
  hourval = local.tm_hour;
}

void LED()
{
  if (secondval == 0) 
  {
    if (LDR_ONOFF == true)
    {
      Licht_Dimmer();
      strip.setBrightness(Dimmer); // set brightness
      strip.show();
    }
    else
    {
      strip.setBrightness(DAYBRIGHTNESS);
      strip.show();
    }
  }
  else
  {
    if (LDR_ONOFF == 0)
    {
      strip.setBrightness(DAYBRIGHTNESS);
      strip.show();
    }
  }

  hourval = hourval % 12; // This clock is 12 hour, if 13-23, convert to 0-11`

  hourval = (hourval * 60 + minuteval) / 12; //each red dot represent 24 minutes.

  // arc mode
  for (uint8_t i = 0; i < strip.numPixels(); i++) {

    if (i <= secondval) {
      // calculates a faded arc from low to maximum brightness
      pixelColorBlue = (i + 1) * (255 / (secondval + 1));
      //pixelColorBlue = 255;
    }
    else {
      pixelColorBlue = 0;
    }

    if (i <= minuteval) {
      pixelColorGreen = (i + 1) * (255 / (minuteval + 1));
      //pixelColorGreen = 255;
    }
    else {
      pixelColorGreen = 0;
    }

    if (i <= hourval) {
      pixelColorRed = (i + 1) * (255 / (hourval + 1));
      //pixelColorRed = 255;
    }
    else {
      pixelColorRed = 0;
    }

    strip.setPixelColor((i + STARTPIXEL) % 60, strip.Color(pixelColorRed, pixelColorGreen, pixelColorBlue));
  }
  strip.show();
}

void loop()
{
  NTPSync();  
  Zeitum();    
  LED();
  delay(100);
}

Und was willst Du wissen?

Hallo ,
ich hatte das gerade eben geschrieben ( Netzwerk Forum).
Ich suche die Library xmodem von peter turczak.
Die gefunden Libks funktionieren alle nicht mehr .
Ich will eine Datei (Foto im JPG Format) per GPRS Shield an einen Mailserver versenden.
Hast du sonst eine Lösung für mich ?
GPRS Shield läuft der Rest auch mir fehlt nur noch diese Möglichkeit

Gruß
Thomas

Hat keine Zukunft mehr und wird je nach Anbieter schneller oder nur wenig langsamer abgeschaltet.

Gruß Tommy

@thomasdorn
Nein, ich kann Dir leider nicht helfen. Und auch die, die wissen, was Du wissen willst, können Dir nicht helfen, wenn Du keine klare Frage stellst.
Lies Dir mal das durch.

ok ich werde das Morgen genau spezifizieren ...

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