Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View farshid616's full-sized avatar

farshid616

View GitHub Profile
@farshid616
farshid616 / user.txt
Last active January 13, 2020 16:54
Add dialout permission to user in linux
sudo gpasswd --add USER dialout
@farshid616
farshid616 / draw2d.py
Created July 5, 2018 15:59
Simple drawing 2D coordinate, dynamically with matplotlib
import numpy as np
import matplotlib.pyplot as plt
plt.axis([0, 10, 0, 1])
for i in range(10):
y = np.random.random()
plt.scatter(i, y)
plt.pause(0.05)
@farshid616
farshid616 / gist:760ac82a46254e2b2f0c06a5fc8b3ea0
Last active June 2, 2018 11:15 — forked from mattfelsen/gist:9467420
Splitting strings by a delimiter for Arduino
//
// This is tested and works!
//
String input = "123,456";
int firstVal, secondVal;
for (int i = 0; i < input.length(); i++) {
if (input.substring(i, i+1) == ",") {
firstVal = input.substring(0, i).toInt();
secondVal = input.substring(i+1).toInt();