Skip to content

Instantly share code, notes, and snippets.

Avatar

John Boxall boxalljohn

View GitHub Profile
View blinkyV2-1.ino
/*
"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
View blinkybeta1.ino
/*
"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
View blinkLEDtest.ino
/*
blinky LED test
*/
int red = 2;
int green = 3;
int blue = 4;
int d = 300;
void setup()
{
@boxalljohn
boxalljohn / wfhmessaging.ino
Created Apr 6, 2022
WFH messaging system code for Particle Photon
View wfhmessaging.ino
// 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 Apr 6, 2022
WFH messaging system front end HTML
View hello.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';
View mbp13
matrix.setBrightness(level); // level: 0~15
View mbp12
// required libraries
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
// define matrix object
Adafruit_8x8matrix matrix = Adafruit_8x8matrix();
int y, z;
View mbp11
matrix.drawCircle(x, y, r, LED_ON);
View mbp11
matrix.fillRect(x1, y1, x2, y2, LED_ON);