Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 #define USE_PRINTF (1) 00004 00005 DigitalOut led_blue(PB_5); 00006 00007 00008 //#include <DSPI.h> 00009 #include "OpenBCI_32bit_Library.h" 00010 #include "Definitions.h" 00011 00012 void setup() { 00013 // Bring up the OpenBCI Board 00014 board.begin(); 00015 } 00016 00017 void loop() { 00018 00019 if (board.streaming) { 00020 if (board.channelDataAvailable) { 00021 // Read from the ADS(s), store data, set channelDataAvailable flag to false 00022 board.updateChannelData(); 00023 00024 if (board.timeSynced) { 00025 // Send time synced packet with channel data, current board time, and an accel reading 00026 // X axis is sent on sampleCounter % 10 == 7 00027 // Y axis is sent on sampleCounter % 10 == 8 00028 // Z axis is sent on sampleCounter % 10 == 9 00029 board.sendChannelDataWithTimeAndAccel(); 00030 } else { 00031 // Send standard packet with channel data 00032 board.sendChannelDataWithAccel(); 00033 } 00034 /* 00035 if (board.timeSynced) { 00036 board.sendChannelDataWithTimeAndRawAux(); 00037 } else { 00038 // Send standard packet with channel data 00039 board.sendChannelDataWithRawAux(); 00040 } 00041 */ 00042 } 00043 } 00044 // Check the serial port for new data 00045 if (board.hasDataSerial0()) { 00046 // Read one char and process it 00047 board.processChar(board.getCharSerial0()); 00048 } 00049 } 00050 00051 00052 00053 int main() 00054 { 00055 setup(); 00056 00057 while (1) loop(); 00058 } 00059
Generated on Wed Jul 20 2022 12:01:51 by
1.7.2