Skip to content

Instantly share code, notes, and snippets.

View ihatecsv's full-sized avatar
☢️
Totally tubular

Drake ihatecsv

☢️
Totally tubular
View GitHub Profile
/*
LiquidCrystal Library - Serial Input
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch displays text sent over the serial port
(e.g. from the Serial Monitor) on an attached LCD.
song = "";
setInterval(function() {
if (song != $('#track-name').find('a').text().replace(/ /g, "~") + '|' + $('#track-artist > a').text().replace(/ /g, "~")) {
song = $('#track-name').find('a').text().replace(/ /g, "~") + '|' + $('#track-artist > a').text().replace(/ /g, "~");
$.ajax({
//The URL to process the request
'url': 'https://your.webserver/relay.php?m=' + song,
'type': 'GET',
'success': function(data) {
if (data == "success") {
//This app requires the express and serialport libraries for node. You can get them on NPM with:
//npm install express
//npm install serialport
var app = require('express')();
var http = require('http').Server(app);
var SerialPort = require("serialport").SerialPort;
var serialPort = new SerialPort("COM3", { //change port to your Arduinos port
baudrate: 9600,
<?php
header('Access-Control-Allow-Origin: *');
// was used when API address moved but apps were live on app store.
// create curl resource
$ch = curl_init();
error_log($_GET['m']);
// set url
curl_setopt($ch, CURLOPT_URL, "http://your.node.host:3000/sendmsg?m=" . $_GET['m']);