Skip to content

Instantly share code, notes, and snippets.

View tuttelikz's full-sized avatar
🔨
生き甲斐

San Askaruly tuttelikz

🔨
生き甲斐
View GitHub Profile
@tuttelikz
tuttelikz / open_write_text.py
Created March 8, 2018 07:21
Open a text file and write
text_file = open("Output.txt", "w")
text_file.write("101010")
text_file.close()
@tuttelikz
tuttelikz / print_serial_sensor.arduino
Created March 12, 2018 11:16
Snippet to receive digital value from sensor and print
const int ProxSensor = 2;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(ProxSensor,INPUT);
Serial.begin(9600);
}
void loop() {
@tuttelikz
tuttelikz / led_onoff.arduino
Created March 12, 2018 11:18
Snippet to on/off from sensor receiving
const int ProxSensor = 2;
void setup() {
// put your setup code here, to run once:
pinMode(13, OUTPUT);
pinMode(ProxSensor,INPUT);
Serial.begin(9600);
}
void loop() {
@tuttelikz
tuttelikz / read_analog.arduino
Created March 12, 2018 11:26
Snippet to read analog signal
//const int ProxSensor = 2;
void setup() {
// put your setup code here, to run once:
//pinMode(13, OUTPUT);
//pinMode(ProxSensor,INPUT);
Serial.begin(9600);
}
void loop() {
@tuttelikz
tuttelikz / send_bluetooth.arduino
Created March 12, 2018 12:23
Script to establish bluetooth connection with android and arduino.
//http://www.martyncurrey.com/arduino-and-hc-06-zs-040/
#include <SoftwareSerial.h>
SoftwareSerial BTserial(10,11); // RX | TX
void setup()
{
Serial.begin(9600);
Serial.println("Enter AT commands:");
@tuttelikz
tuttelikz / show_serial_with_bluetooth.arduino
Last active March 13, 2018 03:16
Script to send sensor information with bluetooth to terminal
#include <SoftwareSerial.h>
SoftwareSerial BTserial(10,11); // RX | TX
int sensorPin = A3;
int sensorValue = 0;
void setup()
{
Serial.begin(9600);
@tuttelikz
tuttelikz / move_folders_files.sh
Last active March 14, 2018 02:15
Linux command to move folders and files to another destination
Move folders:
mv -t <destination> <src1> <src2> .... <srnN>
Move files:
mv file1 file2 file3 -t DESTINATION
@tuttelikz
tuttelikz / copy_all_files_folder.sh
Created March 21, 2018 12:48
Script to copy all files from folder
cp -a /source/. /dest/
@tuttelikz
tuttelikz / string_formatting_android.java
Created March 22, 2018 09:58
String manipulation in android
//To process string in android:
//We can take substrings by indicating indexes until specific separator
String filename_only = sourceDirectory.substring(sourceDirectory.lastIndexOf("/")+1, sourceDirectory.length());
@tuttelikz
tuttelikz / analyze_sound_fft_amplitude.py
Created March 23, 2018 14:57
Script to analyze sound in terms of fft and amplitude
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function
import scipy.io.wavfile as wavfile
import scipy
import scipy.fftpack
import numpy as np
from matplotlib import pyplot as plt