This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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.