This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <BluetoothSerial.h> | |
#include <WiFi.h> | |
#include <NTPClient.h> | |
#include <WiFiUdp.h> | |
#define NOTE_B0 31 | |
#define NOTE_C1 33 | |
#define NOTE_CS1 35 | |
#define NOTE_D1 37 | |
#define NOTE_DS1 39 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Ethernet.h> | |
// MAC address from Ethernet shield sticker under board | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
IPAddress ip(192, 168, 1, 177); // Enter the IP of Ethernet shield | |
IPAddress myDns(192, 168, 1, 1); | |
// Initialize the Ethernet client library | |
EthernetClient client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <Ethernet.h> | |
// MAC address for your Ethernet shield (this is a placeholder, replace with your shield's MAC address) | |
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; | |
// Your network settings (if you want to set a static IP) | |
IPAddress ip(192, 168, 1, 177); // IP address for the Ethernet shield | |
IPAddress myDns(192, 168, 1, 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces | |
from micropython import const | |
import framebuf | |
# register definitions | |
SET_CONTRAST = const(0x81) | |
SET_ENTIRE_ON = const(0xA4) | |
SET_NORM_INV = const(0xA6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from machine import Pin, SoftSPI | |
import ssd1306 | |
from time import sleep | |
spi = SoftSPI(baudrate=500000, polarity=1, phase=0, sck=Pin(14), mosi=Pin(13), miso=Pin(12)) | |
dc = Pin(4) # data/command | |
rst = Pin(5) # reset | |
cs = Pin(15) # chip select, some modules do not have a pin for this |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# MicroPython SSD1306 OLED driver, I2C and SPI interfaces | |
from micropython import const | |
import framebuf | |
# register definitions | |
SET_CONTRAST = const(0x81) | |
SET_ENTIRE_ON = const(0xA4) | |
SET_NORM_INV = const(0xA6) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
#include <ESP8266HTTPClient.h> | |
#include <WiFiClient.h> | |
#include <ArduinoJson.h> | |
const char* ssid = "replacewithyourSSID"; | |
const char* password = "replacewithyourNetworkPassword"; | |
const char* API_KEY = "replacewithyourWeatherAPIkey"; | |
long sunriseTimeMinutes; | |
long localTimeMinutes; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <ESP8266WiFi.h> | |
const char* ssid = "YOUR_WIFI_SSID"; | |
const char* password = "YOUR_WIFI_PASSWORD"; | |
const char* server = "maker.ifttt.com"; | |
const char* IFTTT_KEY = "YOUR_IFTTT_KEY"; | |
const char* EVENT_NAME = "send_email_from_arduino"; | |
const int inputPin = 5; | |
WiFiClient client; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import WiFiManager | |
from time import sleep | |
import machine | |
try: | |
import usocket as socket | |
except: | |
import socket | |
led = machine.Pin(2, machine.Pin.OUT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import network | |
import socket | |
import ure | |
import time | |
ap_ssid = "WifiManager" | |
ap_password = "tayfunulu" | |
ap_authmode = 3 # WPA2 | |
NETWORK_PROFILES = 'wifi.dat' |