Skip to content

Instantly share code, notes, and snippets.

View boxalljohn's full-sized avatar

John Boxall boxalljohn

View GitHub Profile
/*
"blinky" the one-eyed clock - Version 2.1
John Boxall 04 August 2010/6th April 2022
IDGAF licence
DS1307/i2c timekeeping based on code by Maurice Ribble
17-4-2008 - http://www.glacialwanderer.com/hobbyrobotics
*/
#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68
/*
"blinky" the one-eyed clock
Version beta 1
John Boxall August 2010/6th April 2022 - http://tronixstuff.com
DS1307/i2c timekeeping based on code by Maurice Ribble 17-4-2008 - http://www.glacialwanderer.com/hobbyrobotics
*/
#include "Wire.h"
#define DS1307_I2C_ADDRESS 0x68
/*
blinky LED test
*/
int red = 2;
int green = 3;
int blue = 4;
int d = 300;
void setup()
{
@boxalljohn
boxalljohn / wfhmessaging.ino
Created April 6, 2022 08:06
WFH messaging system code for Particle Photon
// WFH Messaging system.
// Modified version of code provided by particle.io documentation.
// Use at your own risk.
int led0 = D0;
int led1 = D1;
int led2 = D2;
int led3 = D3;
int led4 = D4;
int buzzer = D5;
@boxalljohn
boxalljohn / hello.html
Created April 6, 2022 08:04
WFH messaging system front end HTML
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/particle-api-js@8/dist/particle.min.js"></script>
<script>
var particle = new Particle();
// This is incredibly insecure, and only ideal for local tasks of no consequence if things go wrong.
const accessToken = 'ENTER YOUR ACCESS TOKEN HERE';
const deviceId = 'ENTER YOUR DEVICE ID HERE';
matrix.blinkRate(x);
matrix.setBrightness(level); // level: 0~15
// required libraries
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
// define matrix object
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
int y, z;
matrix.drawCircle(x, y, r, LED_ON);
matrix.fillRect(x1, y1, x2, y2, LED_ON);