Skip to content

Instantly share code, notes, and snippets.

@edwios
edwios / OLED_Photon.ino
Last active September 26, 2015 13:04
OLED Driver for Particle-Photon
/****************************************************************************
*****************************************************************************
**************************** OLED Driver *********************************
*** 1.3" 12864 OLED with SH1106 and Simplified Chinese IC for Spark Core ***
*****************************************************************************
****************************************************************************/
int Rom_CS = A2;
unsigned long fontaddr=0;
char dispCS[32];
@edwios
edwios / particle-photon-aes-encryption-demo.ino
Last active November 12, 2016 20:06 — forked from towynlin/spark-aes-encryption-demo.ino
Demo Particle (formerly Spark) Photon firmware using AES-128-CBC
#include "application.h"
#include "spark_protocol.h"
#include "tropicssl/rsa.h"
#include "tropicssl/aes.h"
void sixteenRandomBytes(unsigned char buf[16]) {
for (int i = 0; i < 16; i++) {
buf[i] = rand() & 0xff;
}
}