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
// Red Light Green Light | |
// Hook an LED up to digital pin 9 (Red LED) | |
// Hoop an LED up to digital pin 7 (Green LED) | |
// The Red LED will blink for a second then shut off | |
// Once the Red LED shuts off the Green LED will turn on | |
void setup() | |
{ | |
DDRB = (1<<PB1); // set pin 9 (Arduino UNO) as output |
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 "wavetable.h" | |
float seconds = 0; | |
int i = 0; | |
int num_readings = 0; | |
void setup() | |
{ | |
Serial.begin(115200); | |
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
# Fixed Amplitude (Maximum) | |
import numpy as np | |
table = [] | |
two_pi = 2*np.pi | |
res = 20 | |
top = 500 | |
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
# Variable Amplitude | |
import numpy as np | |
table = [] | |
two_pi = 2*np.pi | |
res = 2000 | |
top = 249 | |
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
/* takeReading function | |
* takes in an analaog pin number as an integer | |
* sends serial data to PC to be read by Python | |
*/ | |
void takeReading(int pinNum) | |
{ | |
Serial.print(seconds,4); | |
Serial.print(','); | |
Serial.println(analogRead(pinNum)); | |
} |
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
import serial | |
import csv | |
import re | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
portPath = "/dev/ttyACM0" # Must match value shown on Arduino IDE | |
baud = 115200 # Must match Arduino baud rate | |
timeout = 5 # Seconds | |
filename = "data.csv" |
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
> cmake -G "Unix Makefiles" -D CMAKE_TOOLCHAIN_FILE=xcompile.cmake .. | |
-- The C compiler identification is GNU 4.8.2 | |
-- The CXX compiler identification is GNU 4.8.2 | |
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc | |
-- Check for working C compiler: /usr/bin/i686-w64-mingw32-gcc -- works | |
-- Detecting C compiler ABI info | |
-- Detecting C compiler ABI info - done | |
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ | |
-- Check for working CXX compiler: /usr/bin/i686-w64-mingw32-g++ -- works |
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
> make -j4 cefclient cefsimple | |
Scanning dependencies of target libcef_dll_wrapper | |
Scanning dependencies of target libcef_dll_wrapper | |
[ 2%] [ 2%] [ 2%] Building CXX object libcef_dll/CMakeFiles/libcef_dll_wrapper.dir/base/cef_atomicops_x86_gcc.cc.obj | |
Building CXX object libcef_dll/CMakeFiles/libcef_dll_wrapper.dir/base/cef_bind_helpers.cc.obj | |
i686-w64-mingw32-g++: error: /MP: No such file or directory | |
i686-w64-mingw32-g++: error: /Gy: No such file or directory | |
i686-w64-mingw32-g++: error: /GR-: No such file or directory | |
i686-w64-mingw32-g++: error: /Zi: No such file or directory | |
i686-w64-mingw32-g++: error: /W4: No such file or directory |
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
set(CMAKE_SYSTEM_NAME Windows) | |
set(CMAKE_C_COMPILER /usr/bin/i686-w64-mingw32-gcc) | |
set(CMAKE_CXX_COMPILER /usr/bin/i686-w64-mingw32-g++) | |
set(CMAKE_RC_COMPILER /usr/bin/i686-w64-mingw32-windres) |
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
function set(obj, path, value) { | |
const clone = Object.assign({}, obj); | |
const keys = path.split('.'); | |
const lastKey = keys.pop(); | |
// -------------------------------------------------- | |
if (keys.length === 0) { | |
clone[lastKey] = value; | |
return clone; |
OlderNewer