This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![allow(dead_code)] | |
#![allow(non_upper_case_globals)] | |
extern crate egl; | |
extern crate libc; | |
use egl::{EGLConfig, EGLDisplay, EGLNativeWindowType, EGLSurface, EGLint}; | |
use gr_context::Context; | |
use opengles::glesv2 as gl; | |
use std::ffi::CString; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Original source in https://forums.pimoroni.com/t/hyperpixel-selective-output-eg-on-boot/5193/15 | |
# | |
# Reboots the RPi enabling/disabling HDMI/Hyperpixel depending if HDMI is used or not | |
# If the machine starts to reboot on a loop, mount /boot on a different machine, and | |
# create a file in /boot/no-display-reboot | |
_HDMI_DEVICE=$(tvservice -l | perl -n -e '/Display Number (\d+), type HDMI 0$/ && print $1') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function () { | |
const originalPrimaryColor = document.querySelector('.xl.light').style.color; //'rgb(178, 178, 178)'; | |
const secondaryColor = [...document.querySelectorAll('path')] | |
.map(c => c.computedStyleMap().get('stroke').toString()) | |
.find(f => f != 'none' && f != originalPrimaryColor); //'rgb(126, 95, 50)'; | |
const originalFadedColor = document.querySelector('.lc.s').style.color; //'rgb(229, 229, 229)'; | |
const backgroundColor = document.body.style.backgroundColor; // "rgb(125, 90, 37)" | |
const newPrimaryColor = 'rgb(0, 0, 0)'; | |
const newSecondaryColor = 'rgb(192, 192, 192)'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--------------------------------------------- | |
2014-07-27 - Texy / Adafruit - 1.8" SPI TFT display, 160x128 18-bit color - ST7735R driver (LCD/TFT) | |
# http://www.adafruit.com/products/618 | |
# http://www.adafruit.com/products/358 | |
# http://www.raspberrypi.org/forums/viewtopic.php?f=64&t=40677 - 1.8 TFT LCD add-on shield board | |
# http://www.raspberrypi.org/forums/viewtopic.php?f=59&t=43286 - 1.8" TFT LCD Shield board v2 | |
# http://www.raspberrypi.org/forums/viewtopic.php?f=93&t=43286&p=396430#p396430 - "switching the backlight on and off works!" | |
"I removed the connectors of pins 15 and 16 between the TFT board and the shield board, rewired pin 15 to the 3.3V rail, and pin 16 to collector in a standard NPN transistor. Base of this transistor is connected to a free GPIO out and emitter goes to GND." | |
# http://minhdanh2002.blogspot.pt/2013/11/experimenting-with-st7735-18-128x160.html - LCD board pinout | |
# http://www.raspberrypi.org/forums/viewtopic.php?t=40677 - Este tem os botões !! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function promisify(server) { | |
var _eval = server.eval; | |
server.eval = function promisifiedEval(cmd, context, filename, callback) { | |
_eval(cmd, context, filename, function (err, result) { | |
if (err) { | |
callback(err); | |
return; | |
} | |
Promise.resolve(result).then(function (result) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Install kernel modules | |
mkdir -p ~/work/share/lcd/adafruit-pitft-2.8 | |
cd ~/work/share/lcd/adafruit-pitft-2.8 | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140724-1.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://learn.adafruit.com/adafruit-pitft-28-inch-resistive-touchscreen-display-raspberry-pi/software-installation | |
mkdir -p ~/work/share/adafruit-pitft-2.8 | |
cd ~/work/share/adafruit-pitft-2.8 | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-bin-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-dev-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi-doc-adafruit.deb | |
wget http://adafruit-download.s3.amazonaws.com/libraspberrypi0-adafruit.deb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var known = [ 1, 6, 3, 9, 4 ]; | |
var presented = [ 2, 5, 7, 4, 9, 4 ]; | |
function done(missing, extraneous) { | |
console.log('Missing:', missing); | |
console.log('Extraneous:', extraneous); | |
} | |
check(known, presented, done); |
NewerOlder