Cette page fournit une simple interface de navigation pour trouver des entités décrites par une propriété et une valeur nommée. D’autres interfaces de recherche disponibles comprennent la page recherche de propriété, et le constructeur de requêtes ask.
| Module « 4 matrices de LEDs » | Microcontrôleur |
|---|---|
VCC
| USB
|
GND
| GND
|
DIN
| MOSI
|
CLK
| SCK
|
CS
| 4
|
[EXAMPLE] When a '''user1''' publishes an image on social media, then only the '''user2''' subscribed to '''user1''' can view/receive the image. Here, the '''user1''' is the '''PUBLISHER''', '''user2''' is the '''SUBSCRIBER''', and the '''user1's account''' is the '''BROKER'''.* According to the above analogy, the image that is published is the data, that was '''transferred from user1 to user2''' 📤. And that is the exact scenario in an MQTT Pub/Sub model. * We have a more secure layer 🔒 to make sure the data is shared t'''hrough a specific path, we call th'''at 'topic', When use'''r1''' publishes data on topic, the subscriber automatically receives if already connected to the broker. Hence, t'''he''' LOW latency.connected to the broker. Hence, t'''he''' LOW latency.)
Examples:
Turn on the lights when the sun sets.
Receive an alert if you accidentally leave the garage door open.'''Extendable with Add-Ons''': Home Assistant isn’t limited to its core functionality. You can easily install additional applications (add-ons) to enhance your setup.
Examples:
Run AdGuard for DNS-based ad blocking.
Use NodeRed for third-party automation.
Turn Home Assistant into a Spotify Connect target.'''Local Data Privacy''': Unlike cloud-based solutions, Home Assistant keeps your data local. It communicates directly with your devices without relying on external servers. Your privacy is preserved, and no data is stored in the cloud. '''Companion Mobile Apps''': Control your devices and receive notifications using the official Home Assistant apps. These apps also enable presence detection, allowing you to trigger automation based on your location. Rest assured, your data is sent directly to your home, with no third-party access. '''Installation Options:''' '''Home Assistant OS''': A ready-to-use image for devices like Raspberry Pi, Odroid, or Intel NUC. '''Home Assistant Supervised''': Install Home Assistant on a generic Linux system using Docker. '''Home Assistant Container''': Run Home Assistant in a Docker container. '''Home Assistant Core''': For advanced users who prefer manual installation on Python environments. By setting it up in a virtual machine, you can experiment with Home Assistant without affecting your primary Windows environment. === Prerequisites: === * '''Windows 11''': Ensure you’re running Windows 11 on your host machine. * '''VirtualBox''': Download and install VirtualBox if you haven’t already.re you’re running Windows 11 on your host machine. * '''VirtualBox''': Download and install VirtualBox if you haven’t already.)
Indian 4G Band Details''' '''"LTE-FDD:B1/B3/B7/B20 LTE-TDD: B40/B41"'''
Without hesitation, I procured the [https://www.seeedstudio.com/SenseCAP-Multi-Platform-LoRaWAN-Indoor-Gateway-SX1302-4G-EU868-p-5599.html SenseCAP Multi-Platform LoRaWAN Indoor Gateway(SX1302-4G) - EU868] at $149, including $30 shipping and $90 Indian customs fees.U868] at $149, including $30 shipping and $90 Indian customs fees.)// Variables qui ne peuvent être modifiées,
const int buttonPin = 2; // Bouton poussoir
const int ledPin = 7; // Anneau NeoPixel Ring 12 LED RGB
// Bibliothèque urilisée pour écran OLED
#include
// =======================
// Paramètrages écran OLED
// =======================
#define nombreDePixelsEnLargeur 128 // Taille de l'écran OLED, en pixel, au niveau de sa largeur
#define nombreDePixelsEnHauteur 64 // Taille de l'écran OLED, en pixel, au niveau de sa hauteur
#define brocheResetOLED -1 // Reset de l'OLED partagé avec l'Arduino (d'où la valeur à -1, et non un numéro de pin)
#define adresseI2CecranOLED 0x3C // Adresse de "mon" écran OLED sur le bus i2c (généralement égal à 0x3C ou 0x3D)
Adafruit_SSD1306 ecranOLED(nombreDePixelsEnLargeur, nombreDePixelsEnHauteur, &Wire, brocheResetOLED);
// ================
// Image à afficher
// ================
#define largeurDeLimage 128 // Largeur de l'image à afficher, en pixels
#define hauteurDeLimage 64 // Hauteur de l'image à afficher, en pixels
const unsigned char imageAafficher [] PROGMEM = {
// Logo SPACE FLAN (image BITMAP / LCD Assistant / Editeur de texte / https://passionelectronique.fr/ecran-oled-i2c-arduino/)
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x07, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf0, 0xf0, 0x3f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0, 0xf0, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc4, 0x73, 0x83, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0e, 0x77, 0x03, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xef, 0x06, 0xf7, 0x39, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x06, 0x63, 0xff, 0x30, 0xe0, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x26, 0x73, 0xff, 0xe0, 0xe4, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xe6, 0xff, 0xff, 0xe6, 0x67, 0x1f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xe3, 0xec, 0xff, 0xff, 0xe6, 0x67, 0x87, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xc7, 0xcc, 0xff, 0xff, 0xfe, 0x77, 0xe3, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x9f, 0xcc, 0xff, 0xff, 0xfe, 0x33, 0xf1, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x3f, 0xd9, 0xff, 0xff, 0xfe, 0x33, 0xfc, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfe, 0x7f, 0x99, 0x7f, 0xff, 0xfe, 0x33, 0xfe, 0x7f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0x99, 0x7f, 0xff, 0xff, 0x3b, 0xff, 0x3f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf9, 0xff, 0x9a, 0x7f, 0xff, 0xf9, 0x19, 0xff, 0x1f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0xb2, 0x77, 0xff, 0x79, 0x19, 0xff, 0x9f, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xf3, 0xff, 0x32, 0x67, 0xff, 0x39, 0x1d, 0xff, 0xcf, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xe7, 0xff, 0x32, 0xe7, 0xdf, 0x39, 0x9d, 0xff, 0xef, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xcf, 0xff, 0x74, 0xe7, 0xdf, 0x3d, 0x8c, 0xff, 0xe7, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xcf, 0xfe, 0x64, 0xe7, 0xdf, 0x3d, 0x8c, 0xff, 0xf7, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xdf, 0xfe, 0x64, 0xe7, 0xdf, 0x3c, 0x8e, 0xff, 0xf3, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x9f, 0xfe, 0x64, 0xe7, 0xdf, 0x3c, 0x86, 0x7f, 0xf3, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x9f, 0xfc, 0xed, 0xef, 0xdf, 0xbc, 0xc6, 0x7f, 0xf9, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xbf, 0xfc, 0xc9, 0xcf, 0xdf, 0xbc, 0xc7, 0x3f, 0xf9, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xf1, 0xc9, 0xcf, 0x9f, 0x9e, 0xc7, 0x1f, 0xf9, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x3f, 0xe3, 0xc9, 0xcf, 0x9f, 0x9e, 0xc3, 0x8f, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0xc7, 0xdb, 0xcf, 0x9f, 0x9e, 0x63, 0xe7, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x8f, 0x93, 0xcf, 0x9f, 0x9e, 0x63, 0xf3, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x1f, 0x93, 0xcf, 0x9f, 0x9e, 0x63, 0xf9, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7f, 0x3f, 0x93, 0xdf, 0x9f, 0x9e, 0x63, 0xfc, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7e, 0x7f, 0xb7, 0xdf, 0x9f, 0x9f, 0x73, 0xfc, 0xfd, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7c, 0xff, 0xa7, 0x9f, 0x9f, 0x9f, 0x33, 0xfe, 0x7d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7c, 0xff, 0x87, 0x9f, 0x9f, 0x9f, 0x33, 0xfe, 0x7d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x79, 0xff, 0x87, 0x9f, 0x9f, 0x9f, 0x33, 0xff, 0x3d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x79, 0xff, 0xe7, 0x9f, 0x9f, 0xdf, 0x23, 0xff, 0x3d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x7b, 0xff, 0xe7, 0x9f, 0x9f, 0xdf, 0x07, 0xff, 0x9d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x73, 0xff, 0xe7, 0xbf, 0x9f, 0xdf, 0x8f, 0xff, 0x9d, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x33, 0xff, 0xe3, 0x3f, 0x9f, 0xcf, 0x9f, 0xff, 0xc9, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0x87, 0xff, 0xf0, 0x3f, 0x9f, 0xcf, 0x3f, 0xff, 0xc1, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf8, 0xfc, 0x3f, 0x9f, 0xcc, 0x3e, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf2, 0x7f, 0x9f, 0x9f, 0xc0, 0x7c, 0x9f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xff, 0xc0, 0x0f, 0x01, 0xfc, 0xcf, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x8f, 0xe0, 0x00, 0x3f, 0xee, 0x67, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x8f, 0xfd, 0xe0, 0x7f, 0xc3, 0x37, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x27, 0xff, 0xff, 0xff, 0x93, 0xb3, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0x64, 0x7f, 0xff, 0xfb, 0x99, 0x99, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfe, 0xe4, 0x69, 0x3f, 0xff, 0xcb, 0xdd, 0xcc, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xfe, 0x0c, 0x0b, 0x3c, 0x47, 0x89, 0xcc, 0xe6, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0x1c, 0x13, 0x30, 0xc7, 0x9d, 0xec, 0x77, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xfd, 0xf3, 0x73, 0xdf, 0x9c, 0xe0, 0x73, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe7, 0x67, 0xdf, 0xdc, 0xe3, 0x7f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xe2, 0x6f, 0xdf, 0xc6, 0xe3, 0x3f, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xe0, 0xcf, 0xdf, 0xc6, 0x7b, 0xbf, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xec, 0x4f, 0xcf, 0xce, 0x79, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xcc, 0xcf, 0xc7, 0xcf, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdd, 0xcf, 0xc7, 0xef, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xe7, 0xdf, 0xef, 0x0f, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe7, 0xdf, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf1, 0xc7, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf9, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
};
// Array of all bitmaps for convenience. (Total bytes used to store images in PROGMEM = 1040)
const int epd_bitmap_allArray_LEN = 1;
//******************************** Routine pour afficheur LCD **************************
#if (SSD1306_LCDHEIGHT != 64)
#endif
// ANNEAU RING LED 12 PIXELS
#include
#define PIN 7
// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs)
// NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers)
// NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products)
// NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2)
Adafruit_NeoPixel strip = Adafruit_NeoPixel(12, PIN, NEO_GRB + NEO_KHZ800);
// Module sonore wtv020m01
// boolean déclare une variable de type binaire
boolean buttonWasUp = true;
boolean ledEnabled = false;
const int clockPin = 6; // clockpin sur la broche 6
const int dataPin = 9; // datapin sur la broche 9
const int resetPin = 3; // resetpin sur la broche 3
const unsigned int VOLUME_7 = 0xFFF7; //unsigned = variable entière non signée
const unsigned int PLAY_PAUSE = 0xFFFE;
const unsigned int STOP = 0xFFFF;
void setup()
{
Serial.begin(9600); //Initialise la communication entre le PC et Arduino
// Initialisation de l'écran OLED
if(!ecranOLED.begin(SSD1306_SWITCHCAPVCC, adresseI2CecranOLED))
while(1); // Arrêt du programme (boucle infinie) en cas d'échec de l'initialisation
// Affichage d'une image au centre de l'écran
ecranOLED.clearDisplay(); // Effaçage de la mémoire tampon de l'écran OLED
ecranOLED.drawBitmap(
(ecranOLED.width() - largeurDeLimage ) / 2, // Position de l'extrême "gauche" de l'image (pour centrage écran, ici)
(ecranOLED.height() - hauteurDeLimage) / 2, // Position de l'extrême "haute" de l'image (pour centrage écran, ici)
imageAafficher,
largeurDeLimage,
hauteurDeLimage,
WHITE); // "couleur" de l'image
ecranOLED.display(); // Transfert de la mémoire tampon à l'écran OLED, pour affichage
{
// LedPin en sortie
pinMode(ledPin, OUTPUT);
// Bouton poussoir en entrée
pinMode(buttonPin, INPUT);
}
{
strip.begin();
strip.setBrightness(255); //adjust brightness here, maximum à 255
strip.show(); // Initialize all pixels to 'off'
}
pinMode(clockPin, OUTPUT);
pinMode(dataPin, OUTPUT);
pinMode(resetPin, OUTPUT);
digitalWrite(clockPin, HIGH); // aucune différence si je le met en HIGH ou LOW
digitalWrite(dataPin, LOW);
// reset the module (si les 2 lignes dessous retirer le son ne s'allume qu'une fraction de secondes)
digitalWrite(resetPin, HIGH);
delay(100);
sendCommand(VOLUME_7); // Empéche le son de se répèter, si enlevé le son est en boucle
}
void loop()
{
// Programme de lumière LED de 12 secondes
colorWipe(strip.Color(255, 255, 255), 84); // Blanc
colorWipe(strip.Color(255, 0, 0), 84); // Rouge
colorWipe(strip.Color(255, 255, 255), 84); // Blanc
colorWipe(strip.Color(255, 0, 0), 84); // Rouge
colorWipe(strip.Color(255, 255, 255), 84); // Blanc
colorWipe(strip.Color(255, 0, 0), 84); // Rouge
colorWipe(strip.Color(255, 255, 255), 84); // Blanc
colorWipe(strip.Color(255, 0, 0), 84); // Rouge
colorWipe(strip.Color(255, 255, 255), 84); // Blanc
colorWipe(strip.Color(255, 0, 0), 84); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(255, 255, 255), 5); // Blanc
colorWipe(strip.Color(255, 0, 0), 5); // Rouge
colorWipe(strip.Color(0, 0, 0), 5); // Eteindre
while (1);
}
// Remplir les points l’un après l’autre avec une couleur (si supprimé, système de points ne fonctionne plus)
void colorWipe(uint32_t c, uint8_t wait)
{
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}
uint32_t Wheel(byte WheelPos) // je ne sais pas à quoi ça sert
{
// lecture son "0000.wav"
sendCommand(0x0001);
}
void sendCommand(int addr) {
digitalWrite(clockPin, LOW);
delay(2);
for (int i=15; i>=0; i--)
{
delayMicroseconds(50);
if((addr>>i)&0x0001 >0)
{
digitalWrite(dataPin, HIGH);
//Serial.print(1);
}
else
{
digitalWrite(dataPin, LOW);
// Serial.print(0);
}
delayMicroseconds(50);
digitalWrite(clockPin, HIGH);
delayMicroseconds(50);
if(i>0)
digitalWrite(dataPin, LOW);
else
digitalWrite(dataPin, HIGH);
delayMicroseconds(50);
if(i>0)
digitalWrite(clockPin, LOW);
else
digitalWrite(clockPin, HIGH);
delay(20);
}
}
#include "esp_camera.h"
#include
//
// WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality
// Ensure ESP32 Wrover Module or other board with PSRAM is selected
// Partial images will be transmitted if image exceeds buffer size
//
// You must select partition scheme from the board menu that has at least 3MB APP space.
// Face Recognition is DISABLED for ESP32 and ESP32-S2, because it takes up from 15
// seconds to process single frame. Face Detection is ENABLED if PSRAM is enabled as well
// ===================
// Select camera model
// ===================
#define PWDN_GPIO_NUM -1
#define RESET_GPIO_NUM -1
#define XCLK_GPIO_NUM 45
#define SIOD_GPIO_NUM 1
#define SIOC_GPIO_NUM 2
#define Y9_GPIO_NUM 48
#define Y8_GPIO_NUM 46
#define Y7_GPIO_NUM 8
#define Y6_GPIO_NUM 7
#define Y5_GPIO_NUM 4
#define Y4_GPIO_NUM 41
#define Y3_GPIO_NUM 40
#define Y2_GPIO_NUM 39
#define VSYNC_GPIO_NUM 6
#define HREF_GPIO_NUM 42
#define PCLK_GPIO_NUM 5
#include "DFRobot_AXP313A.h"
DFRobot_AXP313A axp;
// ===========================
// Enter your WiFi credentials
// ===========================
const char* ssid = "*****";
const char* password = "******";
void startCameraServer();
void setup() {
Serial.begin(115200);
Serial.setDebugOutput(true);
Serial.println();
while(axp.begin() != 0){
Serial.println("init error");
delay(1000);
}
axp.enableCameraPower(axp.eOV2640);//Enable the power for camera
camera_config_t config;
config.ledc_channel = LEDC_CHANNEL_0;
config.ledc_timer = LEDC_TIMER_0;
config.pin_d0 = Y2_GPIO_NUM;
config.pin_d1 = Y3_GPIO_NUM;
config.pin_d2 = Y4_GPIO_NUM;
config.pin_d3 = Y5_GPIO_NUM;
config.pin_d4 = Y6_GPIO_NUM;
config.pin_d5 = Y7_GPIO_NUM;
config.pin_d6 = Y8_GPIO_NUM;
config.pin_d7 = Y9_GPIO_NUM;
config.pin_xclk = XCLK_GPIO_NUM;
config.pin_pclk = PCLK_GPIO_NUM;
config.pin_vsync = VSYNC_GPIO_NUM;
config.pin_href = HREF_GPIO_NUM;
config.pin_sscb_sda = SIOD_GPIO_NUM;
config.pin_sscb_scl = SIOC_GPIO_NUM;
config.pin_pwdn = PWDN_GPIO_NUM;
config.pin_reset = RESET_GPIO_NUM;
config.xclk_freq_hz = 20000000;
config.frame_size = FRAMESIZE_UXGA;
config.pixel_format = PIXFORMAT_JPEG; // for streaming
//config.pixel_format = PIXFORMAT_RGB565; // for face detection/recognition
config.grab_mode = CAMERA_GRAB_WHEN_EMPTY;
config.fb_location = CAMERA_FB_IN_PSRAM;
config.jpeg_quality = 12;
config.fb_count = 1;
// if PSRAM IC present, init with UXGA resolution and higher JPEG quality
// for larger pre-allocated frame buffer.
if(config.pixel_format == PIXFORMAT_JPEG){
if(psramFound()){
config.jpeg_quality = 10;
config.fb_count = 2;
config.grab_mode = CAMERA_GRAB_LATEST;
} else {
// Limit the frame size when PSRAM is not available
config.frame_size = FRAMESIZE_SVGA;
config.fb_location = CAMERA_FB_IN_DRAM;
}
} else {
// Best option for face detection/recognition
config.frame_size = FRAMESIZE_240X240;
#if CONFIG_IDF_TARGET_ESP32S3
config.fb_count = 2;
#endif
}
#if defined(CAMERA_MODEL_ESP_EYE)
pinMode(13, INPUT_PULLUP);
pinMode(14, INPUT_PULLUP);
#endif
// camera init
esp_err_t err = esp_camera_init(&config);
if (err != ESP_OK) {
Serial.printf("Camera init failed with error 0x%x", err);
return;
}
sensor_t * s = esp_camera_sensor_get();
// initial sensors are flipped vertically and colors are a bit saturated
if (s->id.PID == OV3660_PID) {
s->set_vflip(s, 1); // flip it back
s->set_brightness(s, 1); // up the brightness just a bit
s->set_saturation(s, -2); // lower the saturation
}
// drop down frame size for higher initial frame rate
if(config.pixel_format == PIXFORMAT_JPEG){
s->set_framesize(s, FRAMESIZE_QVGA);
}
#if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM)
s->set_vflip(s, 1);
s->set_hmirror(s, 1);
#endif
#if defined(CAMERA_MODEL_ESP32S3_EYE)
s->set_vflip(s, 1);
#endif
WiFi.begin(ssid, password);
WiFi.setSleep(false);
while (WiFi.status() != WL_CONNECTED) {
delay(500);
Serial.print(".");
}
Serial.println("");
Serial.println("WiFi connected");
startCameraServer();
Serial.print("Camera Ready! Use 'http://");
Serial.print(WiFi.localIP());
Serial.println("' to connect");
}
void loop() {
// Do nothing. Everything is done in another task by the web server
delay(10000);
}
Vous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #