Skip to content

Instantly share code, notes, and snippets.

View andrewjaykeller's full-sized avatar

AJ Keller andrewjaykeller

View GitHub Profile
/*
Demonstrates advanced raw access to the advertisement and scan response packets.
This example only applies if you have a specific need for raw access to the advertisement
packet. This is for advanced use only, as the Simblee will not advertise is the packet
is invalid.
*/
/*
* Copyright (c) 2015 RF Digital Corp. All Rights Reserved.
@andrewjaykeller
andrewjaykeller / getting started
Last active November 16, 2016 22:42
OpenBCI wifi
Wifi
For the firmware that runs on ESP8266 see [OpenBCI_Wifi](https://github.com/PushTheWorld/OpenBCI_Wifi) on PushTheWorld’s github repository.
For the software that runs on OpenBCI, we will start from scratch with an ino file that just does SPI.
The ESP8266 runs arduino as well so there are several installs that need to happen in order to make that work. Simply google search ESP8266 Arduino and you will see the github repo with instructions. We must clone and download the library into your Arduino libraries folder. We have to do this because we need the “SPISlave” feature that has not been published in their latest release.
@andrewjaykeller
andrewjaykeller / PTW-Arduino-Assert.ino
Created July 25, 2017 20:51
A simple example for Push The World Arduino assert library
#include <PTW-Arduino-Assert.h>
void setup() {
// Start hardware Serial for debug
Serial.begin(115200);
// Set serial for library
test.setSerial(Serial);
}
void loop() {
if (Serial.available()) {
Serial.read();
@andrewjaykeller
andrewjaykeller / ptw-openbci-wifi-snippit.cpp
Created July 25, 2017 20:52
Snippet from OpenBCI_Wifi firmware
/**
* Used to print out a long long number
* @param n {int64_t} The signed number
* @param base {uint8_t} The base you want to print in. DEC, HEX, BIN
*/
String OpenBCI_Wifi_Class::getStringLLNumber(long long n, uint8_t base) {
return String(n < 0 ? "-" : "") + getStringLLNumber((unsigned long long)(-1*n), base);
}
/**
* Used to print out a long long number
@andrewjaykeller
andrewjaykeller / ptw-openbci-wifi-snippit-test.ino
Created July 25, 2017 20:54
A snippet of test code from OpenBCI_Wifi test code
void testGetStringLLNumber() {
test.describe("getStringLLNumber");
unsigned long long temp_ull = 8388607000000000;
String actualString = wifi.getStringLLNumber(temp_ull);
test.assertEqual(actualString, "8388607000000000", "should be able to convert unsigned long long", __LINE__);
double temp_d = 8388607000000000.5;
actualString = wifi.getStringLLNumber((unsigned long long)temp_d);
@andrewjaykeller
andrewjaykeller / SlaveSPIClass.cpp
Created December 7, 2017 01:32 — forked from shaielc/SlaveSPIClass.cpp
SlaveSPIClass_esp32_Arduino
#include<SlaveSPIClass.h>
int SlaveSPI::size = 0;
SlaveSPI** SlaveSPI::SlaveSPIVector = NULL;
void setupIntr(spi_slave_transaction_t * trans)
{
for(int i=0 ; i<SlaveSPI::size;i++)
{
if(SlaveSPI::SlaveSPIVector[i]->match(trans))
SlaveSPI::SlaveSPIVector[i]->setup_intr(trans);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.