Skip to content

Instantly share code, notes, and snippets.

Avatar
🙄
love vim

Knowblesse knowblesse

🙄
love vim
View GitHub Profile
View LearningArduino.ino
void setup() {
// code below only runs once
pinMode(6,OUTPUT); // setting up the digital pin 6. You don't need to call this func twice.
digitalWrite(6,HIGH); // supply 5V to the digital pin 6
delay(1000); // freeze for 1000ms
digitalWrite(6,LOW); // supply 0V to the digital pin 6
}
void loop() {
// code below runs repeatedly
View organizer.py
from pathlib import Path
import shutil
import re
baselocation = Path(r'D:/정지훈/20FEB')
copylocation = Path(r'C:/Users/SunwhiTDT/Desktop/')
print('Base Location : ')
print(baselocation)
print('\n')
View pyserial.py
import serial
import serial.tools.list_ports
for i in serial.tools.list_ports.comports():
print(i)
mySerial = serial.Serial('COM16',9600, timeout=2)
print(mySerial)
mySerial.write(b'A')
View gist:2cadc11db44fbe02893650b87ab2b67e
resolution = 10;
data=tabulate(...
round(activitydata(:,chnumber) * resolution)...
);
bar(data(:,1),data(:,3)/100,1, 'FaceColor','k');
xlabel('Activity Level x Resolution(a.u.)');
ylabel('Proportion');
View Classifier.py
import sklearn
if (sklearn.__version__ != '0.23.2'):
raise Exception("scikit-learn package version must be 0.23.2")
import os
import numpy as np
from scipy.io import loadmat
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
View gist:1e770aa41fb609189bceaea6f639fd9c
import sklearn
if (sklearn.__version__ != '0.23.2'):
raise Exception("scikit-learn package version must be 0.23.2")
import os
import numpy as np
from scipy.io import loadmat
from sklearn.model_selection import train_test_split
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
View copycopy.m
%% Copy post-clustered data in the old raw data folder to the new raw data folder
basepath = 'D:\Lobster\GR\GR7_NeuroNexus16_v1-180607-151420\GR7';
basepath2 = 'C:\VCF\Lobster\data\rawdata';
filelist = dir(basepath);
workingfile = regexp({filelist.name},'#\S*','match');
workingfile = workingfile(~cellfun('isempty',workingfile));
for f = 1 : numel(workingfile)
View PoleRobot.ino
const int PIN_Motor_L = 3;
const int PIN_Motor_R = 11;
const int PIN_MOTOR_L_DIR = 12;
const int PIN_MOTOR_R_DIR = 13;
void setup() {
Serial.begin(9600);
pinMode(PIN_Motor_R, OUTPUT);
const int PIN_Motor_L = 3;
const int PIN_Motor_R = 11;
const int PIN_MOTOR_L_DIR = 12;
View GSR_arduino_matlab.m
%% GSR_arduino_matlab
% Galvanic Skin Response - Matlab integration script
% 2021 Knowblesse
%% Setup connection
ard = arduino('COM6','Mega2560'); % COM port must be provided manually!
% and this code should be run no more than once, unless you cleared the
% value.
%% Setup DAQ parameters
View number_picker.ino
//https://github.com/JoaoLopesF/SPFD5408
#include <SPFD5408_Adafruit_GFX.h> // Core graphics library
#include <SPFD5408TFTLCDLib.h> // Hardware-specific library
#include <SPFD5408_TouchScreen.h> // Touch Screen library
#define LCD_CS A3 // Chip Select goes to Analog 3
#define LCD_CD A2 // Command/Data goes to Analog 2
#define LCD_WR A1 // LCD Write goes to Analog 1
#define LCD_RD A0 // LCD Read goes to Analog 0