Skip to content

Instantly share code, notes, and snippets.

View CytronTH's full-sized avatar

Cytron Thailand CytronTH

  • Cytron Thailand
View GitHub Profile
@CytronTH
CytronTH / control_relay_gpio17&27.py
Created July 2, 2024 15:37
Test how to control relay connect to Raspberry Pi 5 GPIO27 and GPIO17
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()
@CytronTH
CytronTH / robot_arm.ino
Created February 29, 2024 03:53
Robot arm using Maker Uno and servo motor
#include <Servo.h>
Servo Servo_X;
Servo Servo_Y;
Servo Servo_Grip;
#define Joy_X A0
#define Joy_Y A1
#define BUTTON 2
@CytronTH
CytronTH / docker-compose.yml
Created January 24, 2024 18:16
Data logger software deploy using docker-compose
version: "3"
services:
#Portainer - For manage container
portainer:
image: portainer/portainer-ce:latest
ports:
- "9443:9443"
volumes:
@CytronTH
CytronTH / line_notify_grovewifi.ino
Created January 11, 2024 04:32
Line Notify for micro:bit using GroveWifi
#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);
@CytronTH
CytronTH / grovewifi.ino
Last active April 11, 2023 15:11
Please install TridentTD_LineNotify arduino libraries before compiling this code
#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);
@CytronTH
CytronTH / coin_th.ino
Created February 3, 2023 08:55
coin sorting machine sourcecode for thai currency
#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;
@CytronTH
CytronTH / pico-traffic-light.py
Created October 6, 2021 03:12
Make your traffic light simulator from Raspberry Pi Pico with Micropython
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)