Skip to content

Instantly share code, notes, and snippets.

View JarekParal's full-sized avatar

Jaroslav Páral JarekParal

View GitHub Profile
@JarekParal
JarekParal / analogWriteAndSerial.ino
Last active December 11, 2016 18:27
Arduino: AnalogWrite() control by Serial communication (Usart) - set LED brightness throw Serial monitor in Arduino Ide
// Control the LED brightness by sending value throw Serial monitor in Arduino Ide
// AnalogWrite() reference: https://www.arduino.cc/en/Reference/AnalogWrite
// Select the ride pin which support PWM mode for analogWrite()
// Pinout Arduino Nano: https://goo.gl/Dffq8f (the pins with oscillation symbol - PWM pin in legend)
int LED_PIN = 11;
// Next step - use Serial.parseInt() for control brightness
// ParseInt() reference: https://www.arduino.cc/en/Serial/ParseInt
// Example end of this file
int tlac = 8;
int led = 9;
int stav = 0;
void setup() {
// put your setup code here, to run once:
pinMode(led, OUTPUT);
pinMode(tlac, INPUT_PULLUP);
}
@JarekParal
JarekParal / RK4-test-edit.c
Created January 19, 2017 12:47
Edited version of RK4
// edit of this version RK4: https://www.fit.vutbr.cz/study/courses/IMS/public/priklady/rk4-test.c.html
#include <stdio.h>
void Dynamic(double t, double st[] /* *y */, unsigned N, /* out */ double in[] /* *yin */)
{
// y’’’ + 7y’ - 5 = 0
in[0] = st[1] * -7 + 5;
in[1] = st[0];
in[2] = st[1];
@JarekParal
JarekParal / tex-pictures-figeres-two-column.tex
Created February 21, 2017 16:31
Two pictures/figures in two column (two methods)
\begin{figure}[h]
\begin{minipage}[b]{.5\textwidth}
\centering
\includegraphics[width=\textwidth]{images/pololu-3pi-robot-8-on-line.jpg}
\caption[Robot Pololu 3pi]{Robot Pololu 3pi\protect\footnotemark}
\label{fig:pololu-3pi-robot-8-on-line}
\end{minipage}
\hfill
\begin{minipage}[b]{.5\textwidth}
\centering
@JarekParal
JarekParal / KiCAD_gerbers_rename_for_Gatema_Pool_servis.py
Last active March 13, 2017 00:41 — forked from xesscorp/rename_gerbers.py
Python script for renaming KiCad Gerber files for manufactory Gatema and their Pool servis (prototype PCB)
# Original source: https://gist.github.com/xesscorp/8a2ed1b8923f04ae6366
# Edit by Jarek Paral <paral@robotikabrno.cz>
#
# KiCad outputs Gerber files with extensions that aren't recognized by the most commonly used
# PCB manufacturers. This Python script renames the files to what want manufactory Gatema for
# (company in Czech Republic which produce PCB - http://www.gatema.cz) Pool servis - prototype PCB
# (http://pcb.gatema.cz/kriteria-dat-pro-pool-servis/).
# Just execute this script in your KiCad project directory and the Gerber files will be renamed.
#
@JarekParal
JarekParal / overleaf-find_comment-regex.txt
Created April 30, 2017 14:46
Regex for find and delete Overleaf comment in LaTeX source code
\%\s\*[\s\S]*?Z\.
@JarekParal
JarekParal / analogWriteESP32-1.cpp
Last active July 11, 2017 10:25
analogWrite() on ESP32 - example 1
#include "LearningKit.h"
void setup() {
Serial.begin(115200);
setupRgbLed();
setupLeds();
setupButtons();
ledcSetup(0, 1000, 10); // ledcSetup(channel, freq, resolution)
// channel = 0 - 15
@JarekParal
JarekParal / analogWriteESP32-2.cpp
Created July 11, 2017 10:23
analogWrite() on ESP32 - example 2
#include "LearningKit.h"
void setup() {
Serial.begin(115200);
setupRgbLed();
setupLeds();
setupButtons();
ledcSetup(0, 1000, 10); // ledcSetup(channel, freq, resolution)
// channel = 0 - 15
@JarekParal
JarekParal / clock-2.cpp
Created July 12, 2017 07:25
Clock - example 2 - with alarm
#include "LearningKit.h"
int hour, min, sec;
bool alarm = false;
void setup() {
Serial.begin(115200);
setupLeds();
setupRgbLed();
setupButtons();
@JarekParal
JarekParal / clock-1.cpp
Created July 12, 2017 07:25
Clock - example 1
#include "LearningKit.h"
int hour, min, sec;
void setup() {
Serial.begin(115200);
setupLeds();
setupRgbLed();
hour = 17;