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
import machine | |
import utime | |
led1_red = machine.Pin(2,machine.Pin.OUT) | |
led1_amber = machine.Pin(3,machine.Pin.OUT) | |
led1_green = machine.Pin(4,machine.Pin.OUT) | |
led2_red = machine.Pin(6,machine.Pin.OUT) | |
led2_amber = machine.Pin(7,machine.Pin.OUT) | |
led2_green = machine.Pin(8,machine.Pin.OUT) |
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 <LiquidCrystal_I2C.h> | |
LiquidCrystal_I2C lcd(0x27, 16, 2); // set the LCD address to 0x27 for a 16 chars and 2 line display | |
#define _1BATH 3 | |
#define _2BATH 4 | |
#define _5BATH 5 | |
#define _10BATH 6 | |
#define PIEZO 8 | |
int count_1BATH = 0; |
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 <TridentTD_LineNotify.h> | |
#define SSID "Your wifi SSID" | |
#define PASSWORD "Your wifi Password" | |
void setup() { | |
Serial.begin(115200); | |
Serial.println("WiFi connecting..."); | |
WiFi.begin(SSID, PASSWORD); | |
while (!WiFi.isConnected()) delay(400); |
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 <TridentTD_LineNotify.h> | |
#define SSID "Your WiFi SSID" //ชื่อ WiFi ที่จะใช้ | |
#define PASSWORD "You WiFi Password" //รหัสผ่านของ WiFi ที่จะใช้ | |
void setup() { | |
Serial.begin(115200, SERIAL_8N1); | |
Serial.println("WiFi connecting..."); | |
WiFi.begin(SSID, PASSWORD); | |
while (!WiFi.isConnected()) delay(400); |
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
version: "3" | |
services: | |
#Portainer - For manage container | |
portainer: | |
image: portainer/portainer-ce:latest | |
ports: | |
- "9443:9443" | |
volumes: |
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 <Servo.h> | |
Servo Servo_X; | |
Servo Servo_Y; | |
Servo Servo_Grip; | |
#define Joy_X A0 | |
#define Joy_Y A1 | |
#define BUTTON 2 |
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
import gpiod | |
import time | |
# Define GPIO chip and lines | |
chip = gpiod.Chip('gpiochip0') | |
relay1_line = chip.get_line(17) | |
relay2_line = chip.get_line(27) | |
# Configure GPIO lines as outputs | |
config = gpiod.line_request() |
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
import cv2 | |
from picamera2 import Picamera2 | |
# Initialize the camera | |
picam2 = Picamera2() | |
picam2.configure(picam2.create_preview_configuration(main={"format": 'XRGB8888', "size": (640, 480)})) | |
picam2.start() | |
cv2.startWindowThread() |
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
import serial | |
import struct | |
import time | |
# Initialize the serial connection to the PZEM-004T | |
# Replace '/dev/ttyUSB0' with the appropriate port on your Jetson Nano | |
serial_port = '/dev/ttyUSB0' | |
baud_rate = 9600 | |
def read_pzem(serial_connection): |
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
#PWM Fan control | |
#fan_tempX is temperature range in millicelcius | |
#fan_temp0_hyst is temperature range ensures that the fan doesn't turn on and off too frequently. | |
#fan_temp0_speed is speed of fan (min 0, max 255) | |
#Config below set PWM fan work: | |
# Fan speed 25% at 35 Celcius | |
# Fan speed 50% at 40 Celcius | |
# Fan speed 75% at 45 Celcius | |
# Fan speed 100% at 50 Celcius |
OlderNewer