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.
Username is casaos, and the password is also same.CasaOS fully supports Raspberry Pi. Also, more computers and development boards and fully compatible with Ubuntu, Debian, Raspberry Pi OS, and CentOS with one-liner installation.spberry Pi OS, and CentOS with one-liner installation.)
git : sudo apt install gitimport machine
import time
import urequests
import network
# Wi-Fi credentials
ssid = 'wifi_name' #input your own wifi name
password = 'password' #input your own password
# IFTTT webhook key
api_key = 'your_own_key' #input your own key
# Connect to Wi-Fi
station = network.WLAN(network.STA_IF)
station.active(True)
station.connect(ssid, password)
while station.isconnected() == False:
pass
print('Connection successful')
print(station.ifconfig())
# Set up ultrasonic sensor
trigger = machine.Pin(4, machine.Pin.OUT)
echo = machine.Pin(5, machine.Pin.IN)
def main():
while True:
# Send trigger pulse
trigger.value(0)
time.sleep_us(5)
trigger.value(1)
time.sleep_us(10)
trigger.value(0)
# Measure duration of echo pulse
while echo.value() == 0:
start = time.ticks_us()
while echo.value() == 1:
end = time.ticks_us()
duration = time.ticks_diff(end, start)
# Calculate distance
distance = duration * 0.034 / 2
# Send data to IFTTT
data = {'value1': distance}
submitData("ultrasonic_distance", data)
# Delay before next measurement
time.sleep(5)
def submitData(event, data):
try:
print('Sending data to IFTTT:', data)
request_headers = {'Content-Type': 'application/json'}
request = urequests.post(
'https://maker.ifttt.com/trigger/'+ event + '/with/key/' + api_key,
json=data,headers=request_headers)
print(request.text)
request.close()
except OSError as e:
print('Failed to send data to IFTTT.', e)
if __name__ == '__main__':
main()Just type the HTML and it will be shown below.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum neque id magna. Mauris sollicitudin nisi sit amet sem. Etiam sit amet lectus a velit interdum facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In tincidunt eleifend neque. Maecenas interdum, neque in fringilla pellentesque, lacus massa eleifend elit, nec scelerisque nulla orci a nunc. Quisque sollicitudin. Sed pulvinar lacus id lacus. Vestibulum imperdiet tellus eget risus. Quisque libero nisl, feugiat eu, euismod at, elementum eget, tellus. Clesto.com

Phasellus sem odio, varius quis, cursus at, ullamcorper eget, turpis. Maecenas a mi. Mauris dignissim lectus malesuada odio. Duis elit arcu, lobortis ut, porta ac, venenatis ornare, odio. Pellentesque scelerisque. Ut elementum laoreet massa. Suspendisse hendrerit odio eget turpis. Cras tellus dui, malesuada id, adipiscing ut, laoreet sed, magna. Phasellus scelerisque aliquet ligula. Quisque vitae elit sit amet enim suscipit interdum. Curabitur laoreet, mauris sit amet aliquet interdum, pede sapien malesuada metus, in tincidunt turpis justo id arcu. Donec gravida odio ac lectus. Nam rutrum ante in nisi laoreet aliquet. Sed at ante.
Nulla facilisi. Nullam cursus scelerisque erat. Praesent convallis rhoncus dui. In hac habitasse platea dictumst. Nullam pellentesque. Mauris ac orci. Donec dictum. Etiam purus tortor, elementum a, posuere nec, pulvinar id, ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque vel justo. Nullam posuere purus sed arcu.
Just type the HTML and it will be shown below.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum neque id magna. Mauris sollicitudin nisi sit amet sem. Etiam sit amet lectus a velit interdum facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In tincidunt eleifend neque. Maecenas interdum, neque in fringilla pellentesque, lacus massa eleifend elit, nec scelerisque nulla orci a nunc. Quisque sollicitudin. Sed pulvinar lacus id lacus. Vestibulum imperdiet tellus eget risus. Quisque libero nisl, feugiat eu, euismod at, elementum eget, tellus. Clesto.com

Phasellus sem odio, varius quis, cursus at, ullamcorper eget, turpis. Maecenas a mi. Mauris dignissim lectus malesuada odio. Duis elit arcu, lobortis ut, porta ac, venenatis ornare, odio. Pellentesque scelerisque. Ut elementum laoreet massa. Suspendisse hendrerit odio eget turpis. Cras tellus dui, malesuada id, adipiscing ut, laoreet sed, magna. Phasellus scelerisque aliquet ligula. Quisque vitae elit sit amet enim suscipit interdum. Curabitur laoreet, mauris sit amet aliquet interdum, pede sapien malesuada metus, in tincidunt turpis justo id arcu. Donec gravida odio ac lectus. Nam rutrum ante in nisi laoreet aliquet. Sed at ante.
Nulla facilisi. Nullam cursus scelerisque erat. Praesent convallis rhoncus dui. In hac habitasse platea dictumst. Nullam pellentesque. Mauris ac orci. Donec dictum. Etiam purus tortor, elementum a, posuere nec, pulvinar id, ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque vel justo. Nullam posuere purus sed arcu.
Just type the HTML and it will be shown below.
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed elementum neque id magna. Mauris sollicitudin nisi sit amet sem. Etiam sit amet lectus a velit interdum facilisis. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; In tincidunt eleifend neque. Maecenas interdum, neque in fringilla pellentesque, lacus massa eleifend elit, nec scelerisque nulla orci a nunc. Quisque sollicitudin. Sed pulvinar lacus id lacus. Vestibulum imperdiet tellus eget risus. Quisque libero nisl, feugiat eu, euismod at, elementum eget, tellus. Clesto.com

Phasellus sem odio, varius quis, cursus at, ullamcorper eget, turpis. Maecenas a mi. Mauris dignissim lectus malesuada odio. Duis elit arcu, lobortis ut, porta ac, venenatis ornare, odio. Pellentesque scelerisque. Ut elementum laoreet massa. Suspendisse hendrerit odio eget turpis. Cras tellus dui, malesuada id, adipiscing ut, laoreet sed, magna. Phasellus scelerisque aliquet ligula. Quisque vitae elit sit amet enim suscipit interdum. Curabitur laoreet, mauris sit amet aliquet interdum, pede sapien malesuada metus, in tincidunt turpis justo id arcu. Donec gravida odio ac lectus. Nam rutrum ante in nisi laoreet aliquet. Sed at ante.
Nulla facilisi. Nullam cursus scelerisque erat. Praesent convallis rhoncus dui. In hac habitasse platea dictumst. Nullam pellentesque. Mauris ac orci. Donec dictum. Etiam purus tortor, elementum a, posuere nec, pulvinar id, ipsum. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Quisque vel justo. Nullam posuere purus sed arcu.
pip install pyserial psutil)
'''Arduino IDE'''
* Latest Arduino IDE or VS Code with PlatformIO
* ESP32 board support installed (Espressif package)
* Libraries: '''Arduino_JSON''' (install via Library Manager)
'''Network'''
* Local Wi‑Fi network credentials (SSID and password) for the ESP32 to host the webserver
(SSID and password) for the ESP32 to host the webserver
)[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.)
1 #include
2 #include
3
4 // WiFi
5 const char *ssid = "xxxxx"; // Enter your Wi-Fi name
6 const char *password = "xxxxx"; // Enter Wi-Fi password
7
8 // MQTT Broker
9 const char *mqtt_broker = "broker.emqx.io";
10 const char *topic = "emqx/esp32";
11 const char *mqtt_username = "emqx";
12 const char *mqtt_password = "public";
13 const int mqtt_port = 1883;
14
15 WiFiClient espClient;
16 PubSubClient client(espClient);
17
18 void setup() {
19 // Set software serial baud to 115200;
20 Serial.begin(115200);
21 // Connecting to a WiFi network
22 WiFi.begin(ssid, password);
23 while (WiFi.status() != WL_CONNECTED) {
24 delay(500);
25 Serial.println("Connecting to WiFi..");
26 }
27 Serial.println("Connected to the Wi-Fi network");
28 //connecting to a mqtt broker
29 client.setServer(mqtt_broker, mqtt_port);
30 client.setCallback(callback);
31 while (!client.connected()) {
32 String client_id = "esp32-client-";
33 client_id += String(WiFi.macAddress());
34 Serial.printf("The client %s connects to the public MQTT broker\n", client_id.c_str());
35 if (client.connect(client_id.c_str(), mqtt_username, mqtt_password)) {
36 Serial.println("Public EMQX MQTT broker connected");
37 } else {
38 Serial.print("failed with state ");
39 Serial.print(client.state());
40 delay(2000);
41 }
42 }
43 // Publish and subscribe
44 client.publish(topic, "Hi, I'm ESP32 ^^");
45 client.subscribe(topic);
46 }
47
48 void callback(char *topic, byte *payload, unsigned int length) {
49 Serial.print("Message arrived in topic: ");
50 Serial.println(topic);
51 Serial.print("Message:");
52 for (int i = 0; i < length; i++) {
53 Serial.print((char) payload[i]);
54 }
55 Serial.println();
56 Serial.println("-----------------------");
57 }
58
59 void loop() {
60 client.loop();
61 }
// 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);
}
pieces.svgVous avez entré un nom de page invalide, avec un ou plusieurs caractères suivants :
< > @ ~ : * € £ ` + = / \ | [ ] { } ; ? #