This file contains hidden or 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 matplotlib.pyplot as plt | |
| from datetime import datetime | |
| import serial | |
| import struct | |
| import math | |
| import os | |
| # Show all packets | |
| VERBOSE = 0 |
This file contains hidden or 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
| t = np.linspace(0, 25, num=10000) | |
| f, (axl, axr) = plt.subplots(1, 2, sharey=True) | |
| newlabel = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9] | |
| newpos = [t/0.343 for t in newlabel] | |
| axl.grid(linestyle='dashed') | |
| axl.set_xlim([0, 25]) |
This file contains hidden or 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 <Arduino.h> | |
| #include <BasicStepperDriver.h> | |
| #define DISABLE_MOTORS false | |
| const int EAR_LEFT_DIR = 48, EAR_LEFT_STEP = 46, EAR_LEFT_ENABLE = 62; // Z | |
| const int EAR_RIGHT_DIR = A1, EAR_RIGHT_STEP = A0, EAR_RIGHT_ENABLE = 38; // X | |
| const int NOSE_TOP_DIR = A7, NOSE_TOP_STEP = A6, NOSE_TOP_ENABLE = A2; // Y | |
| const int NOSE_LEFT_DIR = 34, NOSE_LEFT_STEP = 36, NOSE_LEFT_ENABLE = 30; // E1 |
This file contains hidden or 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
| #define VERSION_MAJOR 0 | |
| #define VERSION_MINOR 2 | |
| // 1.6 MHz is the max frequency of the DAC, so it's easiest | |
| // just to scale everything off of it | |
| const int freq = 1.6e6; | |
| // Duration of a single chirp | |
| const double chirp_duration = 15E-3; |
This file contains hidden or 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 <Arduino.h> | |
| #include <BasicStepperDriver.h> | |
| // Accept a trigger of 's' over Serial1 or Serial2 | |
| #define USE_SERIAL_TRIGGER true | |
| // Enable the motors only when they are being moved | |
| #define DISABLE_MOTORS false | |
| const int EAR_LEFT_DIR = 48, EAR_LEFT_STEP = 46, EAR_LEFT_ENABLE = 62; // Z |
This file contains hidden or 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
| bool flash_read_unique_id(uint32_t *pul_data) { | |
| // Initialize the first EEFC bank in 128-bit mode with 4 wait states | |
| if (efc_init(EFC0, 0, 4)) { | |
| return false; | |
| } | |
| // Enter the unique identifier mode, copy it, and exit | |
| return !efc_perform_read_sequence(EFC0, EFC_FCMD_STUI, EFC_FCMD_SPUI, pul_data, 4); | |
| } |
This file contains hidden or 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
| def main(): | |
| try: | |
| ptu = PTU(PTU_PORT) | |
| except serial.serialutil.SerialException: | |
| print(f'Could not connect to pan-tilt on port {PTU_PORT}') | |
| return | |
| # Open connection to device | |
| ser = serial.Serial(DUE_PORT) | |
| ser.setDTR(False) |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| from datetime import datetime | |
| import numpy as np | |
| import serial | |
| import struct | |
| import time | |
| import math | |
| import os | |
| # Native USB port of Due (use Device Manager to find) |
This file contains hidden or 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
| #define VERSION_MAJOR 0 | |
| #define VERSION_MINOR 2 | |
| // 1.6 MHz is the max frequency of the DAC, so it's easiest | |
| // just to scale everything off of it. 1 ADC channel runs at | |
| // 41.25% (~660 kHz); 2 ADC channels run at 25% (400 kHz each) | |
| const int freq = 1.6e6; | |
| // Duration of a single chirp | |
| const double chirp_duration = 15E-3; |
This file contains hidden or 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 matplotlib.pyplot as plt | |
| from datetime import datetime | |
| import numpy as np | |
| import serial | |
| import struct | |
| import time | |
| import math | |
| import os | |
| # Native USB port of Due (use Device Manager to find) |