This file contains hidden or 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
""" | |
Controlling relay via Telegram using Maker Pi Pico and CircuitPython. | |
Items: | |
- Maker Pi Pico | |
https://my.cytron.io/p-maker-pi-pico | |
- ESP8266 ESP-01 WiFi Module | |
https://my.cytron.io/p-esp-01-wifi-serial-transceiver-module-esp8266 | |
- Grove - Relay | |
https://my.cytron.io/p-grove-relay |
This file contains hidden or 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
# -*- coding: utf-8 -*- | |
# i2c bus (0 — original Pi, 1 — Rev 2 Pi) | |
I2CBUS = 1 | |
# LCD Address | |
ADDRESS = 0x27 | |
import smbus | |
from time import sleep |
This file contains hidden or 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 <SoftwareSerial.h> | |
#include <SimpleDHT.h> | |
SoftwareSerial softSerial(2, 3); // (RX, TX) | |
SimpleDHT11 dht11(5); | |
void setup() { | |
softSerial.begin(9600); | |
} |
This file contains hidden or 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 <NewPing.h> | |
#define TRIGGER_PIN 12 // Arduino pin tied to trigger pin on the ultrasonic sensor. | |
#define ECHO_PIN 11 // Arduino pin tied to echo pin on the ultrasonic sensor. | |
#define MAX_DISTANCE 200 // Maximum distance we want to ping for (in centimeters). Maximum sensor distance is rated at 400-500cm. | |
NewPing sonar(TRIGGER_PIN, ECHO_PIN, MAX_DISTANCE); // NewPing setup of pins and maximum distance. | |
void setup() { | |
Serial.begin(115200); // Open serial monitor at 115200 baud to see ping results. |