Skip to content

Instantly share code, notes, and snippets.

View cesschneider's full-sized avatar
🏠
Working from home

Cesar Schneider cesschneider

🏠
Working from home
View GitHub Profile
@cesschneider
cesschneider / gist:7689698
Last active May 21, 2022 05:23
Code snippet to test Arduino Nano led using breath effect.
/*
Android Breath v0.2
Simulates led breathing found on Android devices.
Tested with Arduino Nano ATmega328.
Cesar Schneider <cesschneider@gmail.com>
https://gist.github.com/cesschneider/7689698
*/
// Pin 13 has an LED connected on most Arduino boards.
# Improvemets for production environment:
# 1. Optimize filtering of undesireable chars using regex
# 2. Distrubute filter/counting tasks between multiples threads
# 3. Create unit test cases with multiple text contents
import re
input = open('data.txt', 'r')
output = open('results.txt', 'w')
remove_chars = ['\n', '-', '.', ',', '"', '(', ')', '[', ']', ':', ';']