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
template<typename T> | |
concept Hittable = requires (T& t, const Vec3<float>& position, const Ray& ray){ | |
{ t.position() } -> std::same_as<Vec3<float>>; | |
{ t.set_position(position) } -> std::same_as<void>; | |
{ t.hit(ray) } -> std::same_as<HitPayload>; | |
}; | |
template<Hittable...Ts> | |
class HittableList { |
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
// Basic demo for accelerometer readings from Adafruit MPU6050 | |
// ESP32 Guide: https://RandomNerdTutorials.com/esp32-mpu-6050-accelerometer-gyroscope-arduino/ | |
// ESP8266 Guide: https://RandomNerdTutorials.com/esp8266-nodemcu-mpu-6050-accelerometer-gyroscope-arduino/ | |
// Arduino Guide: https://RandomNerdTutorials.com/arduino-mpu-6050-accelerometer-gyroscope/ | |
#include <Adafruit_MPU6050.h> | |
#include <Adafruit_Sensor.h> | |
#include <Wire.h> |
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 socket | |
server_address = ("localhost",6205) # The address of the server. its "" because we are in the same machine | |
client_socket = socket.socket(socket.AF_INET,socket.SOCK_STREAM) # same as server | |
client_socket.connect(server_address) # we initialise the connection. this will not finish excuting until the server accepts. | |
message = b'hello from client' # same as server | |
client_socket.send(message) # same as server | |
data = client_socket.recv(1024).decode("utf-8") # same as server | |
print(data) | |
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
/** | |
* @brief MPU6050 constructor. | |
*/ | |
void mpu6050_init(); | |
/** | |
* @brief: Get digital low-pass filter configuration. The DLPF_CFG parameter | |
* sets the digital low pass filter configuration. It also determines the |
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
// RSLB | |
#include <Arduino.h> | |
int trig1 = A3; // FRONT SENSOR | |
int echo1 = A2; | |
int trig2 = A1; // LEFT SENSOR 1 0 | |
int echo2 = A0; |
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 <iostream> | |
#include <string.h> | |
#include "freertos/FreeRTOS.h" | |
#include "freertos/task.h" | |
#include "driver/gpio.h" | |
#include "driver/spi_slave.h" | |
#include "esp_log.h" |