Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
2c258c2
proof of concept
Mew463 Feb 19, 2024
45f117c
all the sensors work with code, no movement yet
Mew463 Feb 21, 2024
35e227f
moved to pynput vs keyboard library
Mew463 Feb 21, 2024
e6370c9
starting work on getting ir beacon connected and communicating with n…
Mew463 Feb 22, 2024
ff99aff
got it translating!
Mew463 Feb 22, 2024
f526f7e
wifi issues, not sure why
Mew463 Feb 22, 2024
cb24d2f
beacon not connector to envisionlocal
Mew463 Feb 22, 2024
15a87ab
works at home, turns out its just envision's wifi
Mew463 Feb 23, 2024
c5c9fc1
before implementing BLE to IR beacon
Mew463 Feb 24, 2024
5750016
finished espnow class
Mew463 Feb 25, 2024
bb92e9c
before fixing python code
Mew463 Feb 25, 2024
53e4e1e
established computer -> ir beacon -> alipay communication
Mew463 Feb 25, 2024
e399833
before switching to only bluetooth
Mew463 Feb 25, 2024
dfc54cf
now using only BLE
Mew463 Feb 25, 2024
e3d95be
all basic things work, just need to work on melty algo
Mew463 Feb 26, 2024
1acb128
file management, increase controller.py readability, ability to chang…
Mew463 Feb 27, 2024
a95869d
before rewriting melty algo
Mew463 Feb 28, 2024
a186496
working well with one filter
Mew463 Feb 29, 2024
5aa920b
motors are now bidrectional, about to fix up alipay code
Mew463 Feb 29, 2024
d4beb0e
motors bidrectional and robot controls are inverteable
Mew463 Mar 1, 2024
5e4f389
Fixed weird bug with IR Receiver,
Mew463 Mar 1, 2024
8b2bfed
added decceleration slowdown code
Mew463 Mar 2, 2024
aba5a58
controls no longer reversed when flipped over
Mew463 Mar 5, 2024
145d7e8
added automatic switching code
Mew463 Mar 7, 2024
b56d16c
fixed boostval to work bidirectionally for tank drive, before trying …
Mew463 Mar 9, 2024
4451fe9
added pid tank drive, commit right before comp
Mew463 Mar 9, 2024
d131848
DSHOT + Led working
Mew463 Mar 26, 2024
ac8f54a
renamed, starting moving to dshot and different type of led driver
Mew463 Apr 2, 2024
a0b2779
DSHOT working with main code
Mew463 Apr 2, 2024
5fe9ddf
dshot + improved movement code.
Mew463 Apr 3, 2024
d9be257
back to meltying, flipover code works, about to integrate accelromete…
Mew463 Apr 4, 2024
2a28b50
auto slowdown working, tracking well, accelrpm should update regardle…
Mew463 Apr 11, 2024
4ab4909
Stable release, everything works. Brownout at ~1300 rpm but pretty su…
Mew463 Apr 16, 2024
aa8b1ca
Fixed keyboard controller bug . uppercase keys now treated as lowerca…
Mew463 Apr 17, 2024
1b154dc
fixed "brownout" problem. Needed to run adxl375 calibration code
Mew463 Apr 19, 2024
9e594ea
added accelerometer calibration while disabled
Mew463 Apr 20, 2024
22e5ee8
redid controls, too easy to accidentally calibrate while disabled
Mew463 Apr 20, 2024
8225243
updated power settings for oreo
Mew463 Apr 20, 2024
646bc21
starting to revise the code, somewhat working code for oreo v2
Mew463 Jun 4, 2024
6fff395
got spiffs file working, trying to get led indication working
Mew463 Jun 23, 2024
d9bf333
individually addressing each led and save profiles working
Mew463 Jun 23, 2024
12a2555
added macro for changing if we hockey puck since hockey puck has to s…
Mew463 Jul 25, 2024
9a51e3d
trying to add gui to oreo
Mew463 Nov 9, 2024
cd325db
after ucsd competition, planning on adding ir beacon interrupt and si…
Mew463 Dec 18, 2024
26d08c7
update
Mew463 Feb 16, 2025
b56a3a5
before cleaning up code, adding enums to ble class
Mew463 Apr 14, 2025
259bd90
right before scar competition
Mew463 May 17, 2025
fff232c
before modifying code for oreov6 headware
Mew463 Nov 21, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added .DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions Archive/ADXL375 Test/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions Archive/ADXL375 Test/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
39 changes: 39 additions & 0 deletions Archive/ADXL375 Test/include/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

This directory is intended for project header files.

A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.

```src/main.c

#include "header.h"

int main (void)
{
...
}
```

Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.

In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.

Read more about using header files in official GCC documentation:

* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes

https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
46 changes: 46 additions & 0 deletions Archive/ADXL375 Test/lib/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@

This directory is intended for project specific (private) libraries.
PlatformIO will compile them to static libraries and link into executable file.

The source code of each library should be placed in an own separate directory
("lib/your_library_name/[here are source files]").

For example, see a structure of the following two libraries `Foo` and `Bar`:

|--lib
| |
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| | |- library.json (optional, custom build options, etc) https://docs.platformio.org/page/librarymanager/config.html
| |
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |
| |- README --> THIS FILE
|
|- platformio.ini
|--src
|- main.c

and a contents of `src/main.c`:
```
#include <Foo.h>
#include <Bar.h>

int main (void)
{
...
}

```

PlatformIO Library Dependency Finder will find automatically dependent
libraries scanning project source files.

More information about PlatformIO Library Dependency Finder
- https://docs.platformio.org/page/librarymanager/ldf.html
15 changes: 15 additions & 0 deletions Archive/ADXL375 Test/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:esp32-s3-devkitc-1]
platform = espressif32
board = esp32-s3-devkitc-1
framework = arduino
lib_deps = adafruit/Adafruit ADXL375@^1.1.2
137 changes: 137 additions & 0 deletions Archive/ADXL375 Test/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,137 @@
#include <Wire.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_ADXL375.h>

#define ADXL375_SCK 13
#define ADXL375_MISO 12
#define ADXL375_MOSI 11
#define ADXL375_CS 10

/* Assign a unique ID to this sensor at the same time */
/* Uncomment following line for default Wire bus */
Adafruit_ADXL375 accel = Adafruit_ADXL375(12345);

/* Uncomment for software SPI */
//Adafruit_ADXL375 accel = Adafruit_ADXL375(ADXL375_SCK, ADXL375_MISO, ADXL375_MOSI, ADXL375_CS, 12345);

/* Uncomment for hardware SPI */
//Adafruit_ADXL375 accel = Adafruit_ADXL375(ADXL375_CS, &SPI, 12345);

void displayDataRate(void)
{
USBSerial.print ("Data Rate: ");

switch(accel.getDataRate())
{
case ADXL343_DATARATE_3200_HZ:
USBSerial.print ("3200 ");
break;
case ADXL343_DATARATE_1600_HZ:
USBSerial.print ("1600 ");
break;
case ADXL343_DATARATE_800_HZ:
USBSerial.print ("800 ");
break;
case ADXL343_DATARATE_400_HZ:
USBSerial.print ("400 ");
break;
case ADXL343_DATARATE_200_HZ:
USBSerial.print ("200 ");
break;
case ADXL343_DATARATE_100_HZ:
USBSerial.print ("100 ");
break;
case ADXL343_DATARATE_50_HZ:
USBSerial.print ("50 ");
break;
case ADXL343_DATARATE_25_HZ:
USBSerial.print ("25 ");
break;
case ADXL343_DATARATE_12_5_HZ:
USBSerial.print ("12.5 ");
break;
case ADXL343_DATARATE_6_25HZ:
USBSerial.print ("6.25 ");
break;
case ADXL343_DATARATE_3_13_HZ:
USBSerial.print ("3.13 ");
break;
case ADXL343_DATARATE_1_56_HZ:
USBSerial.print ("1.56 ");
break;
case ADXL343_DATARATE_0_78_HZ:
USBSerial.print ("0.78 ");
break;
case ADXL343_DATARATE_0_39_HZ:
USBSerial.print ("0.39 ");
break;
case ADXL343_DATARATE_0_20_HZ:
USBSerial.print ("0.20 ");
break;
case ADXL343_DATARATE_0_10_HZ:
USBSerial.print ("0.10 ");
break;
default:
USBSerial.print ("???? ");
break;
}
USBSerial.println(" Hz");
}

void setup(void)
{
USBSerial.begin(115200);
while (!USBSerial);
delay(1000);
USBSerial.println("ADXL375 Accelerometer Test"); USBSerial.println("");
Wire.begin(5,6);
/* Initialise the sensor */
while(!accel.begin())
{
/* There was a problem detecting the ADXL375 ... check your connections */
USBSerial.println("Ooops, no ADXL375 detected ... Check your wiring!");
delay(100);
}

// Range is fixed at +-200g

/* Display some basic information on this sensor */
accel.setTrimOffsets(0, 0, 0);

USBSerial.println("Hold accelerometer flat to set offsets to 0, 0, and -1g...");
delay(1000);
int16_t x, y, z;
x = accel.getX();
y = accel.getY();
z = accel.getZ();
USBSerial.print("Raw X: "); USBSerial.print(x); USBSerial.print(" ");
USBSerial.print("Y: "); USBSerial.print(y); USBSerial.print(" ");
USBSerial.print("Z: "); USBSerial.print(z); USBSerial.print(" ");USBSerial.println(" counts");

// the trim offsets are in 'multiples' of 4, we want to round, so we add 2
accel.setTrimOffsets(-(x+2)/4,
-(y+2)/4,
-(z-20+2)/4); // Z should be '20' at 1g (49mg per bit)

int8_t x_offset, y_offset, z_offset;
accel.getTrimOffsets(&x_offset, &y_offset, &z_offset);
USBSerial.print("Current trim offsets: ");
USBSerial.print(x_offset); USBSerial.print(", ");
USBSerial.print(y_offset); USBSerial.print(", ");
USBSerial.println(z_offset);

USBSerial.println();
}

void loop(void)
{
/* Get a new sensor event */
sensors_event_t event;
accel.getEvent(&event);

/* Display the results (acceleration is measured in m/s^2) */
USBSerial.print("X: "); USBSerial.print(event.acceleration.x); USBSerial.print(" ");
USBSerial.print("Y: "); USBSerial.print(event.acceleration.y); USBSerial.print(" ");
USBSerial.print("Z: "); USBSerial.print(event.acceleration.z); USBSerial.print(" ");USBSerial.println("m/s^2 ");
delay(250);
}
11 changes: 11 additions & 0 deletions Archive/ADXL375 Test/test/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@

This directory is intended for PlatformIO Test Runner and project tests.

Unit Testing is a software testing method by which individual units of
source code, sets of one or more MCU program modules together with associated
control data, usage procedures, and operating procedures, are tested to
determine whether they are fit for use. Unit testing finds problems early
in the development cycle.

More information about PlatformIO Unit Testing:
- https://docs.platformio.org/en/latest/advanced/unit-testing/index.html
34 changes: 34 additions & 0 deletions Archive/AlipayTelemetry.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import socket

class Alipay:
def __init__(self, targetIP, PORT, name):
self.targetIP = targetIP
self.receiveBufferSize = 128
self.PORT = PORT
self.name = name

def get_laptop_ip(self):
laptop_ip = ""
while (laptop_ip == ""):
laptop_ip = socket.gethostbyname_ex(socket.gethostname())[-1]
return laptop_ip

def udp_receiver(self):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("0.0.0.0", self.PORT))

while True:
data, addr = sock.recvfrom(64) # This code is blocking!! Implement whether connected / disconnected from Alipay??
try:
data_str = data.decode("utf-8")
print(f"[{self.name}] {data_str}")
except:
pass

def send_udp_packet(self, data):
with socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as sock:
sock.setsockopt(socket.SOL_SOCKET, socket.SO_SNDBUF, self.receiveBufferSize)
try:
sock.sendto(data.encode(), (self.targetIP, 12345)) # Fixed port because each esp32 has different IP address
except:
pass
Binary file added IR Beacon/.DS_Store
Binary file not shown.
5 changes: 5 additions & 0 deletions IR Beacon/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
10 changes: 10 additions & 0 deletions IR Beacon/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": [
"platformio.platformio-ide"
],
"unwantedRecommendations": [
"ms-vscode.cpptools-extension-pack"
]
}
5 changes: 5 additions & 0 deletions IR Beacon/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"system_error": "cpp"
}
}
39 changes: 39 additions & 0 deletions IR Beacon/include/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@

This directory is intended for project header files.

A header file is a file containing C declarations and macro definitions
to be shared between several project source files. You request the use of a
header file in your project source file (C, C++, etc) located in `src` folder
by including it, with the C preprocessing directive `#include'.

```src/main.c

#include "header.h"

int main (void)
{
...
}
```

Including a header file produces the same results as copying the header file
into each source file that needs it. Such copying would be time-consuming
and error-prone. With a header file, the related declarations appear
in only one place. If they need to be changed, they can be changed in one
place, and programs that include the header file will automatically use the
new version when next recompiled. The header file eliminates the labor of
finding and changing all the copies as well as the risk that a failure to
find one copy will result in inconsistencies within a program.

In C, the usual convention is to give header files names that end with `.h'.
It is most portable to use only letters, digits, dashes, and underscores in
header file names, and at most one dot.

Read more about using header files in official GCC documentation:

* Include Syntax
* Include Operation
* Once-Only Headers
* Computed Includes

https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html
Binary file added IR Beacon/lib/.DS_Store
Binary file not shown.
Loading