Skip to content

Instantly share code, notes, and snippets.

@pmcorreia
pmcorreia / ILI9341_1.ino
Created April 19, 2019 23:57 — forked from calogerus/ILI9341_1.ino
Arduino UNO + 2.4 TFT-LCD-Display-Shield-Touch-Panel-ILI9341-240x320-for-Arduino-UNO-MEGA
void LCD_write(uint8_t d) {
// ILI9341 reads data pins when WR rises from LOW to HIGH (A1 pin on arduino)
PORTC = PORTC & B11111101; // WR 0
// data pins of ILI9341 connected to two arduino ports
PORTD = (PORTD & B00000011) | ((d) & B11111100);
PORTB = (PORTB & B11111100) | ((d) & B00000011);
PORTC = PORTC | B00000010; // WR 1
}
@pmcorreia
pmcorreia / software_for_scientists.md
Created August 29, 2018 23:28 — forked from stared/software_for_scientists.md
Software for scientists: community-edited list of general-purpose software for scientists.

Software for scientists

Some things takes much less time and stress once you know the right tool. Below, there is a community edited list of software for scientists.

Text editors

in General purpose text/code editors. It may be better to have a good editor for everything, than different ones for different languages, scripts, notes.

@pmcorreia
pmcorreia / Digispark.md
Created November 3, 2017 15:44 — forked from Ircama/Digispark.md
Configuring the Digispark ATtiny85 board for Arduino IDE and upgrading the bootloader

Configuring the Digispark ATTINY85 board for Arduino IDE and upgrading the bootloader

This note describes the configuration of an ATtiny85 based microcontroller development board named Digispark and similar to the Arduino line. It is available in many online marketplaces for roughly 1 dollar (e.g., Ebay, Amazon, AliExpress) and is shipped fully assembled, including a V-USB interface (a software-only implementation of a low-speed USB device for Atmel's AVR microcontrollers). Coding is similar to Arduino: it uses the familiar Arduino IDE and is already provided with a ready-to-use bootloader (fully integrated with Arduino), also allowing to be upgraded. Comparing it with the [ATmega328P](ht

@pmcorreia
pmcorreia / peakdet.m
Created February 23, 2016 11:57 — forked from endolith/peakdet.m
Peak detection in Python
function [maxtab, mintab]=peakdet(v, delta, x)
%PEAKDET Detect peaks in a vector
% [MAXTAB, MINTAB] = PEAKDET(V, DELTA) finds the local
% maxima and minima ("peaks") in the vector V.
% MAXTAB and MINTAB consists of two columns. Column 1
% contains indices in V, and column 2 the found values.
%
% With [MAXTAB, MINTAB] = PEAKDET(V, DELTA, X) the indices
% in MAXTAB and MINTAB are replaced with the corresponding
% X-values.