Skip to content

Instantly share code, notes, and snippets.

@xawos
xawos / serial_print_ILI9341.ino
Last active May 25, 2022 22:54
(quick and dirty thingy to) get serial port input to display on the ILI9341 touch display
#include <Elegoo_GFX.h>
#include <Elegoo_TFTLCD.h>
#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4
#define BLACK 0x0000
#define WHITE 0xFFFF
#define TEXT_LEN 12
@xawos
xawos / _RPRND
Last active October 16, 2022 10:56
Rapiddisk RAM cache for Raspberry Pi USB2 disk
Raspberry Pi Rapiddisk Network Disk
Quick install script incuded ;)
This setup assumes you're running a Debian/Ubuntu OS on your Rpi/PC.
Also I assume you have a device on /dev/sda that want to cache with a bit of RAM.
Hack as needed.
#!/bin/bash
# Monitors for file changes, prints them and executes action based on the output
usage() {
echo "Usage:"
echo " bash indiff.sh <file>"
exit 1
}
if [ "$1" == "" ] || [ ! -f "$1" ] || [ "$1" == "help" ]; then
//////////////////////////////////////////////
// Get XML formatted data from the web.
// 1/6/08 Bob S. - Created
//
// Assumptions: single XML line looks like:
// <tag>data</tag> or <tag>data
//
// Get current weather observation for Raleigh from weather.gov in XML format
//
//////////////////////////////////////////////
@xawos
xawos / LaserTripWire
Created June 19, 2014 10:13
LaserTripWire
* Laser trip-wire sketch which implements the following functionality:
* - Calibration to current light environment
* - Visual feedback on alignment
* - Arming and disarming mechanism
const int triggeredLED = 8;
const int RedLED = 10;
const int GreenLED = 7;
const int inputPin = A0;
const int speakerPin = 3;
@xawos
xawos / JavaLCD
Created June 19, 2014 10:10
JavaLCD
/*
Reads from Serial, ends the reading with /0/b and prints it to the LCD (from Java)
*/
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
int i, index = 0;
@xawos
xawos / i2cSniffer
Created June 19, 2014 10:09
i2cSniffer
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
const char sda_pin = A4;
const char scl_pin = A5;
const int data_size = 250;
byte captured_data[data_size];
boolean captured;
boolean dumped;
void setup()
@xawos
xawos / DoorLock
Created June 19, 2014 10:08
DoorLock
#include <Password.h>
#include <LiquidCrystal.h>
#include <Keypad.h>
LiquidCrystal lcd(12, 11, 10, 5, 4, 3, 2);
Password password = Password("1379");
const byte ROWS = 4;
const byte COLS = 3;
char keys[ROWS][COLS] = {
{'1','2','3',},
{'4','5','6',},
@xawos
xawos / Bluetooth Rover
Last active August 29, 2015 14:02
Bluetooth Rover
char dataIn = 'S';
#include <AFMotor.h>
AF_DCMotor Motor1(2);
AF_DCMotor Motor2(1);
char determinant; //Used in the check function, stores the character received from the phone.
char det; //Used in the loop function, stores the character received from the phone.
void setup()
{