Skip to content

Instantly share code, notes, and snippets.

View TiNredmc's full-sized avatar
💚

TinLethax TiNredmc

💚
View GitHub Profile
@TiNredmc
TiNredmc / scdq5541.pde
Created October 13, 2018 04:56 — forked from lpereira/scdq5541.pde
Interfacing Osram SCDQ5541 dot-matrix display with an Arduino
class SCDQ5541 {
private:
int m_clock, m_data, m_load;
void bitbang(unsigned char code)
{
digitalWrite(m_load, LOW);
for (int i = 0; i < 8; i++) {
digitalWrite(m_clock, LOW);
digitalWrite(m_data, code & 0x01);
@TiNredmc
TiNredmc / ComeNCapFPGA.v
Created November 28, 2021 17:13
ComeNCapture Frontend using iCE40LP1K
// ComeNCapture front end part. Handles the data sampling and buffer by using iCE40LP1K FPGA as logic capturer.
// Coded by TinLethax 2021/11/26 +7
// Block RAM module, We use ALL bits of BRAM as STORAGE.
module BRAM(
input CLK,
input RCLK,
input [7:0]BRAM_IN,
output reg [7:0]BRAM_OUT,
#include <stdio.h>
int main(){
printf("0123456789abcdefghij0123456789abcdefghij0123456789abcdefghij0123456789abcdefghij");
printf("\n\t 1234567890\t 1234567890\t 1234567890\t 1234567890");
printf("1234567890\t 1234567890\t 1234567890\t 1234567890\n");
printf("\t 1234567890\t 1234567890\t 1234567890\t 1234567890");
printf("12345678123456781234567812345678123456781234567812345678123456781234567812345678");
printf("\t1\t12\t123\t1234\t12345\t123456\t1234567\t12345678\n");
printf("12345678\t12345678\t12345678\t12345678\t12345678");
@TiNredmc
TiNredmc / bq2754x_unseal.sh
Last active February 2, 2022 07:27
Unseal the Fuel gauge protection of BQ27541/BQ27542 via i2ctransfer on Linux
#!/bin/bash
# Simple Script to Fully Unseal the BQ27541 or BQ27542
# Coded by TinLethax 2021/06/02 +7
# structure [Control_command0x00][lower byte][higher byte]
# Unseal first by writing 0x0414 (Sending Big endian )
i2ctransfer -y -f -a 0 w3@0x55 0x00 0x14 0x04
# Then writing 0x3672 (again, Big endian first)
i2ctransfer -y -f -a 0 w3@0x55 0x00 0x72 0x36
sleep 1
@TiNredmc
TiNredmc / bq2754x_chkseal.sh
Last active February 2, 2022 07:27
check seal status of the Fuel gauge protection of BQ27541/BQ27542 via i2ctransfer on Linux
#!/bin/bash
# Simple Script to check SEAL status of the BQ27541 or BQ27542
# Coded by TinLethax 2021/06/02 +7
# structure [Control_command0x00][lower byte][higher byte]
# Sending 0x00 subcommand (Sending Big endian )
i2ctransfer -y -f 0 w3@0x55 0x00 0x00 0x00
i2ctransfer -y -f 0 w1@0x55 0x00 r2
echo Done!
@TiNredmc
TiNredmc / bq2754x_seal.sh
Last active February 2, 2022 07:27
Reseal the Fuel gauge protection of BQ27541/BQ27542 via i2ctransfer on Linux
#!/bin/bash
# Simple Script to re-seal the BQ27541 or BQ27542
# Coded by TinLethax 2021/06/02 +7
# structure [Control_command0x00][lower byte][higher byte]
# Sending SEAL subcommand cause it to reseal (Sending Big endian )
i2ctransfer -y -f 0 w3@0x55 0x00 0x20 0x00
sleep 1
i2ctransfer -y -f 0 w3@0x55 0x00 0x00 0x00
i2ctransfer -y -f 0 w1@0x55 0x00 r2
@TiNredmc
TiNredmc / .bashrc
Last active February 2, 2022 08:28
Bashrc setting for F1C100s Buildroot. Just make it more colorful UwU
# Bashrc setting for F1C100s Buildroot. Just make it more colorful UwU
PS1='\[\e[0;38;5;161m\]\h\[\e[0m\]@\[\e[0;38;5;49m\]\u\[\e[0m\]:\[\e[0;38;5;39m\]\w\[\e[0m\]#'
@TiNredmc
TiNredmc / Scanner.c
Created March 20, 2022 07:11
Keyboard scanner using Arduino Mega 2560 to reverse engineer Blackberry Passport Keyboard.
/* Key scanner to reverse engineer Blackberry Passport keyboard pinout.
* Coded By TinLethax (Can't remember the date, probably 2022/03/17).
*/
// https://tinlethax.wordpress.com/2022/03/20/reverse-engineering-blackberry-passport-keyboard-pinout-part-2/
// using Arduino Mega's pin 22 to 38
// I updated the Conversion array (from arduino pin to actual connector pin).
// I sacrificed the keyboard (by taking it apart and bought a new one).
// to probe and get ~70% done with some left to probe with new kerboard (to replace the first one I took apart).
uint8_t toffcpin[16]={
2, 3, 4, 5, 6, 7,
@TiNredmc
TiNredmc / ardu_step_isr.ino
Last active June 17, 2022 07:22
control 2-phase stepper motor with Timer interrupt.
// 500us Timer interrupt to drive stepper motor.
// Coded by TinLethax 2022/6/17 +7
#define full_rev_step 200
#define motor_pulse 2
volatile uint8_t pulse_tog = 0;
volatile uint16_t pulse_cnt = 0;
#define motor_dir 3
uint8_t dir = 0;
@TiNredmc
TiNredmc / point_cloud_xyz_xtion.launch.py
Created July 28, 2023 05:18
Remote Point cloud depth_image_proc launch file for ROS2
# ROS2 Remote Point Cloud Processing launch file using depth_image_proc
# Using this with Asus Xtion (no RGB) camera. Orange Pi Prime running Openni2 camera node.
# Original code by 808brick https://github.com/ros-perception/image_pipeline/issues/823
# Modified by TinLethax 2023/07/28 +7
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
def generate_launch_description():