Skip to content

Instantly share code, notes, and snippets.

View martinandrovich's full-sized avatar
💭
Either coding or crying about coding.

Martin Androvich martinandrovich

💭
Either coding or crying about coding.
View GitHub Profile
@martinandrovich
martinandrovich / mandatory_2.m
Last active June 8, 2020 19:16
ODE and PDE implementations in MATLAB
%#ok<*NOPTS>
format shortG
clear; close all; clc;
% two coupled equations with integral terms:
% u(x) = (e1 * sigma * T1^4) + (1 - e1) * ∫[-0.5w;0.5w] F(x, y, d) * v(y) dy
% v(y) = (e2 * sigma * T2^4) + (1 - e2) * ∫[-0.5w;0.5w] F(x, y, d) * u(x) dx
% constants
#!/bin/bash
# > opensim installation script
# version: 1.0.0
# last modified: 08/05/2020
# -------------------------------------------------------------------------------------------------------
# > sudo test
@martinandrovich
martinandrovich / pi-addr
Last active December 3, 2019 15:45
Raspberry Pi Zero IP address
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP group default qlen 1000
link/ether e4:42:a6:ee:26:9f brd ff:ff:ff:ff:ff:ff
inet 10.126.49.212/19 brd 10.126.63.255 scope global dynamic noprefixroute wlp2s0
valid_lft 5092sec preferred_lft 5092sec
This is some test text file, that can be downloaded from the Linux command line.
@martinandrovich
martinandrovich / linux-pi-zero-config.md
Last active November 20, 2019 11:56
Raspberry Pi Zero configuration on Ubuntu 19.04

Raspberry Pi Zero Configuration


Installation

Flashing

Installing requires downloading the a [Raspbian image][rasp-img-recommended] (archive) and installing using [Etcher][etcher]. The default credentials are username pi and password raspberry.

[{
"title": {
"front": "sonnal-an-chigi",
"back": "Knife Hand Inward Strike",
"korean": "손날 안치기"
},
"desc": "An intermediate technique that is executed by striking with the muscle at the side of the hand located between the base of the small finger and the wrist.",
"img": "http://www.taekwondopreschool.com/images/strike5side.jpg",
"level": 1
},
@martinandrovich
martinandrovich / cli_demo.c
Created March 17, 2019 18:31
Demo of CLI module.
// cli.h
// version 1.0.0
// define callback functions (can be anywhere, not just here)
void some_func(void) { return; }
void some_other_func(void) { return; }
// define some actions manually
// undesired, just an example!
CLI_ACTION act1 = { 0x10, &some_func };
@martinandrovich
martinandrovich / uart_demo.c
Created March 16, 2019 14:58
Demo of UART module.
// uart.h
// version 1.0.1
// create new UART instance with BAUDRATE 9600
// currently not implemented
UART* uart1 = uart.new(2);
// construct UART frame
UART_FRAME frm =
{
@martinandrovich
martinandrovich / spi_test.c
Created March 9, 2019 02:04
Demo of SPI module
// init SPI instance @ 8MHz (
// bps = SYSCLK / (CPSDVSR * (1 + SCR))
SPI* spi_test = spi.new(2);
// send value '110' to PWM1
spi.send(spi_test, PWM1, 110);
// send value '110' to PWM1 and validate
if(!spi.send(spi_test, PWM1, 110))
{
@martinandrovich
martinandrovich / chksum_demo.c
Last active March 15, 2019 13:49
Demo of CHECKSUM module
// chksum.h
// version 1.2.2
// WARNING!
// rewrite "0b0011'0101" to "0b00110101" when using C
// 4-bit checksum test
// input: 1011'1000'1110
// size: 3 nibbles (12 bits)
// output: 1000