|
Smart Poi 3.0.0
WiFi Connected LED POV Poi
|
#include "user_interface.h"#include "LittleFS.h"#include <ESP8266WiFi.h>#include <DNSServer.h>#include <ESP8266WebServer.h>#include <EEPROM.h>#include <ESP8266WiFiMulti.h>#include <WiFiUdp.h>#include <FastLED.h>
Macros | |
| #define | DATA_PIN D2 |
| #define | CLOCK_PIN D1 |
| #define | NUM_LEDS 121 |
| #define | NUM_PX 120 |
| #define | UPDATES_PER_SECOND 30000 |
Functions | |
| IPAddress | apIP (192, 168, 1, 1) |
| IPAddress | apIPauxillary (192, 168, 1, 78) |
| ESP8266WebServer | server (80) |
| IPAddress | ipSubnet (255, 255, 255, 0) |
| IPAddress | ipGateway (192, 168, 8, 1) |
| IPAddress | ipGatewayauxillary (192, 168, 1, 1) |
| IPAddress | ip (192, 168, 8, 77) |
| IPAddress | tmpGateway (192, 168, 8, 1) |
| IPAddress | tmpIP (192, 168, 8, 77) |
| void | setup () |
| Setup function, called once at program start. | |
| void | loop () |
| Main loop function, called repeatedly after setup. | |
Variables | |
| File | fsUploadFile |
| ESP8266WiFiMulti | WiFiMulti |
| int | newBrightness = 20 |
| File | f |
| File | a |
| File | settings |
| boolean | auxillary = false |
| CRGB | leds [121] |
| const int | maxPX = 24000 |
| uint8_t | message1Data [maxPX] |
| int | pxDown = 120 |
| int | pxAcross = pxDown |
| const byte | DNS_PORT = 53 |
| DNSServer | dnsServer |
| int | status = WL_IDLE_STATUS |
| char | apName [] = "Smart_Poi6" |
| char | apPass [] = "SmartOne" |
| int | apChannel = 1 |
| int | keyIndex = 0 |
| uint8_t | addrNumA = 192 |
| uint8_t | addrNumB = 168 |
| uint8_t | addrNumC = 8 |
| uint8_t | addrNumD = 78 |
| const unsigned int | localPort = 2390 |
| byte | packetBuffer [120] |
| WiFiUDP | Udp |
| String | responseHTML |
| String | content |
| int | statusCode |
| unsigned long | previousMillis = 0 |
| unsigned long | previousMillis2 = 0 |
| unsigned long | previousMillis3 = 0 |
| long | interval = 5000 |
| boolean | checkit = false |
| boolean | channelChange = false |
| boolean | savingToSpiffs = false |
| unsigned long | previousFlashy = 0 |
| const long | intervalBetweenFlashy = 5 |
| boolean | black = true |
| int | state = 0 |
| boolean | upDown = true |
| boolean | lines = true |
| CRGBPalette16 | currentPalette |
| TBlendType | currentBlending = NOBLEND |
| int | paletteVar = 1 |
| int | motionSpeed = 1 |
| int | maxStartIndex = 70 |
| int | minStartIndex = 0 |
| volatile int | setting = 2 |
| int | patternChooser = 2 |
| int | pattern = 2 |
| int | wifiModeChooser = 1 |
| int | imageChooser = 1 |
| boolean | preloaded = false |
| int | byteCounter = 0 |
| boolean | tempSwitch = true |
| String | Field |
| int | imageToUse = 0 |
| int | maxImages = 52 |
| int | minImages = 0 |
| String | images = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
| String | bin = "a.bin" |
| int | uploadCounter = 1 |
| boolean | wifiEventDetect = false |
| boolean | start = true |
| boolean | routerOption = false |
| volatile byte | X |
| volatile byte | Y |
| volatile byte | R1 |
| volatile byte | G1 |
| volatile byte | M1 |
| volatile unsigned long | currentMillis = millis() |
| volatile unsigned long | currentMillis2 = millis() |
| volatile int | packetSize |
| volatile int | len |
| #define CLOCK_PIN D1 |
Referenced by setup().
| #define DATA_PIN D2 |
Referenced by fastLEDInit(), and setup().
| #define NUM_LEDS 121 |
| #define NUM_PX 120 |
Referenced by fastLEDIndicateFast(), and handleUDP().
| #define UPDATES_PER_SECOND 30000 |
| IPAddress apIP | ( | 192 | , |
| 168 | , | ||
| 1 | , | ||
| 1 | ) |
| IPAddress apIPauxillary | ( | 192 | , |
| 168 | , | ||
| 1 | , | ||
| 78 | ) |
| IPAddress ip | ( | 192 | , |
| 168 | , | ||
| 8 | , | ||
| 77 | ) |
| IPAddress ipGateway | ( | 192 | , |
| 168 | , | ||
| 8 | , | ||
| 1 | ) |
| IPAddress ipGatewayauxillary | ( | 192 | , |
| 168 | , | ||
| 1 | , | ||
| 1 | ) |
| IPAddress ipSubnet | ( | 255 | , |
| 255 | , | ||
| 255 | , | ||
| 0 | ) |
| void loop | ( | ) |
Main loop function, called repeatedly after setup.
Handles various tasks such as:
| None |
References bin, ChangePatternPeriodically(), currentMillis, currentMillis2, dnsServer, funColourJam(), images, imageToUse, interval, maxImages, minImages, pattern, previousMillis, routerOption, server(), showLittleFSImage(), start, and state.

| ESP8266WebServer server | ( | 80 | ) |
Referenced by getContentType(), handleFileCreate(), handleFileDelete(), handleFileList(), handleFileRead(), handleFileUpload(), handleOptions(), loop(), and webServerSetupLogic().

| void setup | ( | ) |
Setup function, called once at program start.
Initializes digital pins, FastLED, serial communication, and EEPROM settings. Also mounts the LittleFS file system, loads router settings, and checks files.
| None |
References checkFilesInSetup(), CLOCK_PIN, DATA_PIN, eepromBrightnessChooser(), eepromPatternChooser(), eepromReadChannelAndAddress(), eepromRouterOptionChooser(), eepromWifiModeChooser(), fastLEDIndicate(), fastLEDIndicateFast(), fastLEDInit(), littleFSLoadSettings(), localPort, and Udp.

| IPAddress tmpGateway | ( | 192 | , |
| 168 | , | ||
| 8 | , | ||
| 1 | ) |
| IPAddress tmpIP | ( | 192 | , |
| 168 | , | ||
| 8 | , | ||
| 77 | ) |
| File a |
| uint8_t addrNumA = 192 |
Referenced by eepromReadChannelAndAddress(), webServerSetupLogic(), and wifiChooser().
| uint8_t addrNumB = 168 |
Referenced by eepromReadChannelAndAddress(), webServerSetupLogic(), and wifiChooser().
| uint8_t addrNumC = 8 |
Referenced by eepromReadChannelAndAddress(), webServerSetupLogic(), and wifiChooser().
| uint8_t addrNumD = 78 |
Referenced by eepromReadChannelAndAddress(), webServerSetupLogic(), and wifiChooser().
| int apChannel = 1 |
Referenced by eepromReadChannelAndAddress(), and wifiChooser().
| char apName[] = "Smart_Poi6" |
Referenced by wifiChooser().
| char apPass[] = "SmartOne" |
Referenced by wifiChooser().
| boolean auxillary = false |
Referenced by fastLEDIndicate(), fastLEDIndicateFast(), and wifiChooser().
| String bin = "a.bin" |
Referenced by loop(), and showLittleFSImage().
| boolean black = true |
Referenced by SetupPurpleAndGreenPalette().
| int byteCounter = 0 |
| boolean channelChange = false |
Referenced by handleUDP().
| boolean checkit = false |
Referenced by handleUDP().
| String content |
Referenced by webServerSetupLogic().
| TBlendType currentBlending = NOBLEND |
| volatile unsigned long currentMillis = millis() |
Referenced by handleUDP(), and loop().
| volatile unsigned long currentMillis2 = millis() |
Referenced by handleUDP(), and loop().
| CRGBPalette16 currentPalette |
Referenced by FillLEDsFromPaletteColors(), FillPatternStripesFromPaletteColors(), FillStripesFromPaletteColors(), PaletteSetup(), SetupBlackAndWhiteStripedPalette(), SetupPurpleAndGreenPalette(), SetupRandomVariablePalette(), SetupRandomVariablePalette2(), SetupTotallyRandomPalette(), SetupVariablePalette(), SetupVariablePalette3(), SetupVariablePalette5(), SetupVariablePalette6(), and SetupVariablePalette7().
| const byte DNS_PORT = 53 |
Referenced by wifiChooser().
| DNSServer dnsServer |
Referenced by loop(), and wifiChooser().
| File f |
Referenced by SetupVariablePalette6(), and SetupVariablePalette7().
| String Field |
Referenced by littleFSLoadSettings().
| File fsUploadFile |
Referenced by handleFileUpload().
| volatile byte G1 |
Referenced by handleUDP(), and showLittleFSImage().
| int imageChooser = 1 |
| String images = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" |
Referenced by handleFileUpload(), and loop().
| int imageToUse = 0 |
Referenced by ChangePatternPeriodically(), loop(), and showLittleFSImage().
| long interval = 5000 |
Referenced by ChangePatternPeriodically(), handleUDP(), loop(), and webServerSetupLogic().
| const long intervalBetweenFlashy = 5 |
| int keyIndex = 0 |
| CRGB leds[121] |
| volatile int len |
Referenced by handleUDP().
| boolean lines = true |
Referenced by ChangePalettePeriodically3(), and funColourJam().
| const unsigned int localPort = 2390 |
Referenced by setup().
| volatile byte M1 |
Referenced by handleUDP(), and showLittleFSImage().
| int maxImages = 52 |
Referenced by ChangePatternPeriodically(), and loop().
| const int maxPX = 24000 |
Referenced by checkFilesInSetup(), checkFileSpace(), handleFileUpload(), and showLittleFSImage().
| int maxStartIndex = 70 |
Referenced by funColourJam().
| uint8_t message1Data[maxPX] |
Referenced by showLittleFSImage().
| int minImages = 0 |
Referenced by ChangePatternPeriodically(), and loop().
| int minStartIndex = 0 |
Referenced by funColourJam().
| int motionSpeed = 1 |
Referenced by funColourJam().
| int newBrightness = 20 |
Referenced by eepromBrightnessChooser(), fastLEDInit(), handleUDP(), and webServerSetupLogic().
| byte packetBuffer[120] |
Referenced by handleUDP().
| volatile int packetSize |
| int paletteVar = 1 |
Referenced by ChangePaletteEveryTime().
| int pattern = 2 |
Referenced by eepromPatternChooser(), loop(), readAnotherPatternEEProm(), and webServerSetupLogic().
| int patternChooser = 2 |
Referenced by eepromPatternChooser(), and webServerSetupLogic().
| boolean preloaded = false |
| unsigned long previousFlashy = 0 |
| unsigned long previousMillis = 0 |
Referenced by handleUDP(), and loop().
| unsigned long previousMillis2 = 0 |
Referenced by handleUDP().
| unsigned long previousMillis3 = 0 |
Referenced by ChangePatternPeriodically().
| int pxAcross = pxDown |
Referenced by showLittleFSImage().
| int pxDown = 120 |
Referenced by showLittleFSImage().
| volatile byte R1 |
Referenced by handleUDP(), and showLittleFSImage().
| String responseHTML |
Referenced by webServerSetupLogic().
| boolean routerOption = false |
Referenced by eepromRouterOptionChooser(), eepromWifiModeChooser(), loop(), and webServerSetupLogic().
| boolean savingToSpiffs = false |
| volatile int setting = 2 |
Referenced by ChangePalettePeriodically3(), ChangeStripesPeriodically(), and funColourJam().
| File settings |
Referenced by littleFSLoadSettings(), and webServerSetupLogic().
| boolean start = true |
Referenced by loop().
| int state = 0 |
Referenced by handleUDP(), and loop().
| int status = WL_IDLE_STATUS |
| int statusCode |
Referenced by webServerSetupLogic().
| boolean tempSwitch = true |
| WiFiUDP Udp |
Referenced by handleUDP(), and setup().
| boolean upDown = true |
Referenced by funColourJam().
| int uploadCounter = 1 |
Referenced by handleFileUpload(), and wifiChooser().
| boolean wifiEventDetect = false |
| int wifiModeChooser = 1 |
Referenced by eepromWifiModeChooser(), fastLEDIndicate(), fastLEDIndicateFast(), and wifiChooser().
| ESP8266WiFiMulti WiFiMulti |
Referenced by wifiChooser().
| volatile byte X |
Referenced by handleUDP(), and showLittleFSImage().
| volatile byte Y |
Referenced by handleUDP().