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
# | |
# Small ftp server for ESP8266 ans ESP32, Pico W Micropython | |
# | |
# Based on the work of chrisgp - Christopher Popp and pfalcon - Paul Sokolovsky | |
# | |
# The server accepts passive mode only. | |
# It runs in foreground and quits, when it receives a quit command | |
# Start the server with: | |
# | |
# import ftp |
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
from machine import UART, Pin, SPI, PWM, unique_id, reset | |
import time | |
import binascii | |
import struct | |
import network | |
import socket | |
import json | |
from ili9341 import Display, color565 | |
from umqtt.simple import MQTTClient |
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
#!/usr/bin/env python3 | |
# coding=utf-8 | |
# from here https://github.com/YahboomTechnology/CUBE_Pi/tree/main/3.%20Chassis%20driver%20tutorial/2.%20OLED%20display | |
# I modify this script to show CPU temperator, remove the fourd line of IP and increase the line height from 8 to 10px | |
import time | |
import os | |
import sys | |
import Adafruit_SSD1306 as SSD |
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
# script to auto turn off and on the fan of CUBE pi case based on CPU temp | |
import time | |
import os | |
from CubeRaspberryLib import CubeRaspberry | |
# Khởi tạo bot CUBE Pi | |
bot = CubeRaspberry(i2c_bus=1) | |
# Ngưỡng nhiệt độ | |
TEMP_ON = 50 # Bật quạt khi nhiệt độ >= 50°C |
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
[Unit] | |
Description=yahboom_oled start service | |
After=multi-user.target | |
[Service] | |
Type=idle | |
User=michaelphan | |
ExecStart=/bin/sh -c "/home/michaelphan/cubipi/.env/bin/python3 /home/michaelphan/cubipi/oled.py" | |
WorkingDirectory=/home/michaelphan | |
ExecStopPost=/bin/sh -c "/home/michaelphan/cubipi/.env/bin/python3 /home/michaelphan/cubipi/oled.py clear" |
OlderNewer