Skip to content

Instantly share code, notes, and snippets.

View shiva-karthick's full-sized avatar
🎯
Focusing

Shiva Karthick shiva-karthick

🎯
Focusing
View GitHub Profile
@shiva-karthick
shiva-karthick / shankar_exti_double_button.c
Last active October 18, 2022 06:48
EE2028 Assignment 2
/* Includes ------------------------------------------------------------------*/
#include "main.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_accelero.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_tsensor.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_gyro.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_magneto.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_psensor.h"
#include "../../Drivers/BSP/B-L475E-IOT01/stm32l475e_iot01_hsensor.h"
#include "stdio.h"
#include "stdbool.h"
@shiva-karthick
shiva-karthick / bubble_sort.s
Created September 3, 2022 10:33
EE2028 Assignment 1
/*
* bubble_sort.s
*
* Created on: 4/8/2022
* Author: Shankar
*/
.syntax unified
.cpu cortex-m4
.fpu softvfp
.thumb
## How to get all possible combinations of a list’s elements?
def combs(a):
if len(a) == 0:
return [[]]
cs = []
for c in combs(a[1:]):
cs += [c, c+[a[0]]]
return cs
Public log As Logger
Option Explicit ' Used at the module level to force explicit declaration of all variables in that module
' ================================== Variables for initVars sub ==================================
Dim dutySlotsSheet As String
Dim dutySlotsStartRow As Integer
Dim dateCol As Integer
Dim dayCol As Integer
Dim firstActualCol As Integer
Public log As Logger
' ================================== Variables for initVars sub ==================================
Dim dutySlotsSheet As String
Dim dutySlotsStartRow As Integer
Dim dateCol As Integer
Dim dayCol As Integer
Dim firstActualCol As Integer
Dim firstStbCol As Integer
@shiva-karthick
shiva-karthick / USART.c
Last active March 6, 2023 18:40
USART initialisation for ATmega48A/PA/88A/PA/168A/PA/328/P
/*
Quick and dirty functions that make serial communications work.
Note that receiveByte() blocks -- it sits and waits _forever_ for
a byte to come in. If you're doing anything that's more interesting,
you'll want to implement this with interrupts.
initUSART requires BAUDRATE to be defined in order to calculate
the bit-rate multiplier. 9600 is a reasonable default.
@shiva-karthick
shiva-karthick / opencv_video_to_pygame.py
Created December 11, 2018 18:11 — forked from radames/opencv_video_to_pygame.py
OpenCV VideoCapture running on PyGame
import pygame
from pygame.locals import *
import cv2
import numpy as np
import sys
camera = cv2.VideoCapture(0)
pygame.init()
pygame.display.set_caption("OpenCV camera stream on Pygame")
screen = pygame.display.set_mode([1280,720])
" Author : Shankar (sangha)
"" Searching
set hlsearch " highlight matches
set incsearch " incremental searching
set ignorecase " searches are case insensitive...
set smartcase " ... unless they contain at least one capital letter
TARGET = a
LIBS = -lm
CC = gcc
CFLAGS = -g -Wall
.PHONY: default all clean
default: $(TARGET)
all: default
@shiva-karthick
shiva-karthick / settings.json
Created September 7, 2018 08:49
My VS code settings
{
"cSpell.userWords": [
"zymotic"
],
"editor.formatOnSave": true,
"editor.minimap.enabled": false,
"editor.rulers": [
79,
],
"files.autoSave": "onFocusChange",