Skip to content

Instantly share code, notes, and snippets.

View Shofuuu's full-sized avatar

Muh. Shofuwan Anwar Shofuuu

View GitHub Profile
@Shofuuu
Shofuuu / sim.sh
Created October 7, 2025 12:16
HSPICE bash shell code to help calculate TC, generate backup, restore previous backup, and get the power dissipation
#!/bin/bash
# author: Muhammad Shofuwan Anwar
# created: Oct 1, 2025
if [ $# -eq 0 ]; then
echo "[ERROR] No action specified." >&2
echo "[INFO] Usage: $0 <command> [filename]" >&2
echo "[INFO] Example:" >&2
echo " Simulate: $0 circuit3" >&2
#!/usr/bin/python3
import os
files = [f for f in os.listdir('.') if os.path.isfile(os.path.join('.', f))]
output_files = 'results-count.csv'
tomato = {}
index = 0
print('[INFO] counting the labels')
#include <Arduino.h>
// Urutan data yang akan dikirimkan
typedef struct {
int tank1; // data ke-1
int tank2; // data ke-2
String str; // data ke-3
} data_t;
// data string acak (bebas)
#include <Arduino.h>
#define MOTOR_DIR_CW 0
#define MOTOR_DIR_CCW 1
#define MOTOR_ENABLE 1
#define MOTOR_DISABLE 0
#define STEPPER_PIN_PULL 7
#define STEPPER_PIN_DIR 6
#include <Arduino.h>
#define PAYLOAD_SIZE 3
String payload_array[PAYLOAD_SIZE]; // simpan data dari labview
void parse_read (String data, String extract[PAYLOAD_SIZE]);
void setup() {
pinMode(LED_BUILTIN, OUTPUT);
#include <Arduino.h>
#define PIN_LED0 D8
#define PIN_LED1 D7
#define PIN_LED2 D6
#define PIN_LED3 D5
#define PIN_BTN D2
#define READ_BIT(x,y) ((x & (1 << y)) ? 1:0)
#include <Arduino.h>
#define PIN_LED0 D8
#define PIN_LED1 D7
#define PIN_LED2 D6
#define PIN_LED3 D5
#define PIN_BTN D2
const int pin_map[] = {PIN_LED0, PIN_LED1, PIN_LED2, PIN_LED3};
int counter = 0;
#include <Arduino.h>
#define PIN_LED0 D8
#define PIN_LED1 D7
#define PIN_LED2 D6
#define PIN_LED3 D5
#define PIN_BTN D2
const int pin_map[] = {PIN_LED0, PIN_LED1, PIN_LED2, PIN_LED3};
int counter = 0;
#include <Arduino.h>
// https://github.com/adafruit/DHT-sensor-library
#include <Adafruit_Sensor.h>
#include <DHT.h>
#define DHTPIN D4
#define DHT_TEMP_OFFSET (float)-2.19898
#define DHT_HUMI_OFFSET (float)0.0
#include <Arduino.h>
#define PIN_LED0 D8
#define PIN_LED1 D7
#define PIN_LED2 D6
#define PIN_LED3 D5
#define PIN_BLED D4
#define PIN_GLED D3
#define PIN_RLED D1