- Download MPLab X IDE
- Open MPLab X IDE, and if you don't have a compiler, close it. Otherwise, select your compiler.
- Download a c compiler from here. Since the PIC24 is a 16-bit board, install the XC16 compiler. Documentation for included libraries can be found here
- Open the compiler image and follow the setup instructions for MPLab XC Compiler.
- Once the compiler is finished installing, open MPLab X IDE again - if got a prompt earlier about not having a compiler, you shouldn't get that anymore
- Create a new project, selecting "Standalone project" and the PIC24FJ128GA204 mpu. Then choose the correct compiler (it should eliminate wrong selections for you)
- Create a source file in the "Sourc
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 serial.tools.list_ports | |
def establishPort(port=None): | |
if port: | |
pdb_port = port | |
else: | |
available_ports = list(serial.tools.list_ports.comports()) | |
for port in available_ports: | |
if "ItsyBitsy M0 Express" in port.description: |
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 hlcReport() { | |
if (micros() - hlcReportPrevUpdate > HLC_REPORT_INTERVAL) { | |
char report[100]; | |
sprintf(report, "[%lu,%s,%s,%s,%s]", millis(), String(batt1V, 3).c_str(), String(batt1Curr, 3).c_str(), String(batt2V, 3).c_str(), String(batt2Curr, 3).c_str()); | |
Serial.write(report); | |
memset(report, 0, sizeof(buffer)); | |
} | |
} |
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
if (batt1On && batt1V < BATT_EMPTY && batt2Installed && !batt2On) { | |
ISR_Override = true; | |
digitalWrite(BATT_2_CTL, HIGH); | |
batt2On = true; | |
prevSwitchTime = micros(); | |
Serial.println("Switched to batt 2!"); | |
buffer += "Switching to batt 2"; | |
if (batt2V > BATT_EMPTY) { | |
digitalWrite(BATT_1_CTL, LOW); | |
batt1On = false; |
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
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script> | |
<script src="https://cdn.tailwindcss.com"></script> | |
<script src="https://kit.fontawesome.com/9f3da960b8.js" crossorigin="anonymous"></script> |
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
One True | |
public class StudentClass{ | |
public static void oneTrue(boolean[] myBools){ | |
//enter line of code to set last position/element to true// | |
myBools[myBools.length - 1] = true; | |
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
public class runner { | |
public static void main(String[] args) { | |
// Create an array of length 50 | |
int[] arr = new int[9000]; | |
// Fill arr with random numbers in the range 0-99: | |
for (int x = 0; x < arr.length; x++) { | |
arr[x] = (int)(Math.random() * 100); | |
} |
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
// ****************************************************** | |
// An example of the SimpleFusion library that combines | |
// accelerometer and gyroscope data quickly and easily. | |
// | |
// This example uses the mpu6050 6-dof IMU and the | |
// Adafruit library for it. | |
// | |
// Created in 2022 by Sean Boerhout under the MIT License | |
// ****************************************************** |
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
// ****************************************************** | |
// An example of the SimpleFusion library that combines | |
// accelerometer and gyroscope data quickly and easily. | |
// | |
// This example uses the mpu6050 6-dof IMU and the | |
// Adafruit library for it. | |
// | |
// Created in 2022 by Sean Boerhout under the MIT License | |
// ****************************************************** |
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 <SPI.h> | |
#include <Wire.h> | |
#include <Adafruit_GFX.h> | |
// #include <Adafruit_SSD1306.h> | |
#include <Adafruit_ST7735.h> | |
#include "PinChangeInterrupt.h" | |
#include <StopWatch.h> |