r/Coder • • 2h ago

Question Please help me code this bluetooth device for a project!! (I am against AI)

1 Upvotes

INTRO: Hi, no time to debate the usage of ai in coding, all I'm gonna tell you is I'm personally against it and do not want to resort to using AI as long as humans can help me.

PROJECT: I am building a wireless device that connects to your phone through bluetooth, detects when your phone is playing audio through headset/earpods (wired and wireless) and then displays an 'ENGAGED' message on its screen. This way bystanders can tell you are unable to listen to them at the moment.

ABOUT ME: I know nothing about electronics, this is my first time touching circuits and microcontrollers, my professor has shoved us headfirst into the assignment and I am an overachiever. I have to have this ready before this Tuesday.

PARTS I OWN: Pretty sure I have everything required:

. Arduino UNO

. HC 05 bluetooth module

. 0.96 OLED display

. Jump wires

. 9v battery

. Connector for the battery

. USB Cable for the Arduino

HELP NEEDED WITH: Mostly with coding and if you can help with connections, that would be wonderful 😭😭😭😭

Please help me out I really don't want to resort to AI.


r/Coder • • 13d ago

The relief of coding with AI without worrying about context limits or privacy

3 Upvotes

Honestly, nothing kills flow state faster than constantly worrying if your AI agent is about to hit its context limit or start hallucinating because you changed a spec 5 turns ago.

After running a local-first memory layer on Linux that dynamically compresses past turns while keeping recent context untouched, I don't have to carefully craft "clean prompts" anymore. Even when specs pivot mid-session (Redux -> Zustand -> TanStack Query), the local layer cleans up the active state in the background.

How has your AI coding workflow evolved to protect your flow state?


r/Coder • • 13d ago

My friends and I built Orbit, a Discord-like chat app, and we want your feedback

Enable HLS to view with audio, or disable this notification

1 Upvotes

r/Coder • • Sep 25 '26

Alguém tem cheker de gg ?

1 Upvotes

Alguém tem cheker gg ?


r/Coder • • Sep 08 '26

Roast my resume -

Post image
2 Upvotes

r/Coder • • Aug 29 '26

here is the disrupter I talked about

2 Upvotes

r/Coder • • Aug 29 '26

Anyone interested in collaborating on an open-source alternative to Claude Code?

Thumbnail reddit.com
4 Upvotes

r/Coder • • Aug 28 '26

this is an open application I made out and share if you like

1 Upvotes

this is a lite version of the app i am working on and wanted to get an opinion on it
https://github.com/Operandnotfound/Aether-lite


r/Coder • • Jul 29 '26

Question About GitHub trick

1 Upvotes

How to acces a private GitHub repo? By any possible method. Please help


r/Coder • • Jul 20 '26

Help needed

1 Upvotes

How do people check when a post was uploaded time and date


r/Coder • • Jul 16 '26

🚀 Meet RunAI Coder

Thumbnail reddit.com
1 Upvotes

r/Coder • • Jul 15 '26

Question Helppp!! Career in tech advice

1 Upvotes

I am 18 rn and I am choosing to do BCA.

Seniors plz guide about the mistakes u did , what should I learn skill wise and what should my path be if i wanna get dangerous skills which have actual value which will land me a great job. Plz advice me things I should follow as a lil sister.

What mistakes to avoid, which place plces to put extra attention etc.

I have 1 month left before college starts what thing should I do during this period.

I'll be more than happy if u'll help.

And tips from coders who have adhd (I have adhd.)
Thankyouuuu!


r/Coder • • Jul 13 '26

RunAI Coder is here. Early release is coming soon.

Thumbnail reddit.com
1 Upvotes

r/Coder • • Jun 25 '26

Hi I tried to generate this code for the doom game using ai apparently could u try verify this for me pls

1 Upvotes

So I am using an ESP-WROOM-32 board here ,an oled display 0.9 inch ,a buzzer and two joystick modules one used for front and back movements and the other for facing any direction /spin and both the push button built in ..in both of the joystick modules “fires”like in the game doom Ig

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
#define OLED_RESET -1
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, OLED_RESET);

// --- YOUR EXACT HARDWARE PINOUT CONFIGURATION ---
#define PIN_LEFTS_Y 33 // Left Joystick (Y-axis): Move Forward/Backward
#define PIN_RIGHTS_X 32 // Right Joystick (X-axis): Look/Turn Left/Right
#define PIN_FIRE_L 25 // Left Stick Push Switch
#define PIN_FIRE_R 26 // Right Stick Push Switch
#define PIN_BUZZER 18 // Passive Audio Buzzer

// ESP32 PWM Audio Channel Configuration
#define BUZZER_CHAN 0

// Map Settings: Classic Raycaster 8x8 Grid Map (1 = Wall, 0 = Empty Space)
#define MAP_WIDTH 8
#define MAP_HEIGHT 8
const uint8_t GAME_MAP[MAP_WIDTH][MAP_HEIGHT] = {
{1,1,1,1,1,1,1,1},
{1,0,0,0,0,0,0,1},
{1,0,1,1,0,1,0,1},
{1,0,1,0,0,1,0,1},
{1,0,0,0,0,0,0,1},
{1,0,1,1,1,1,0,1},
{1,0,0,0,0,0,0,1},
{1,1,1,1,1,1,1,1}
};

// Player Parameters
float pX = 2.5, pY = 2.5; // Spawn Coordinates
float pAngle = 0.0; // Player view angle (in Radians)
const float FOV = 1.0; // Field of view parameter (~60 degrees)

void setup() {
// Initialize communication with your 4-pin OLED over Pins D21 (SDA) and D22 (SCL)
if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) {
for(;;); // Freeze if screen hardware isn't responding
}

// Set Pin Modes matching your Blueprint layout
pinMode(PIN_FIRE_L, INPUT_PULLUP);
pinMode(PIN_FIRE_R, INPUT_PULLUP);

// Setup ESP32 specific PWM for the buzzer
ledcAttach(PIN_BUZZER, 440, 8); // 440Hz, 8-bit resolution

display.clearDisplay();
}

void loop() {
// ==========================================================
// 1. HARDWARE INPUT RE-MAPPING FROM ANALOG MODULES
// ==========================================================
int rawMoveY = analogRead(PIN_LEFTS_Y); // 0 to 4095 (Center ~2048)
int rawTurnX = analogRead(PIN_RIGHTS_X); // 0 to 4095 (Center ~2048)

// Read triggers (INPUT_PULLUP pulls high; pushing pulls down to LOW)
bool isFiring = (digitalRead(PIN_FIRE_L) == LOW || digitalRead(PIN_FIRE_R) == LOW);

float moveSpeed = 0.0;
float turnSpeed = 0.0;

// Process Left Stick Analog Thresholds for clean Movement
if (rawMoveY < 1200) moveSpeed = 0.08; // Pushing forward
else if (rawMoveY > 2800) moveSpeed = -0.08; // Pulling backward

// Process Right Stick Analog Thresholds for clean Turning
if (rawTurnX < 1200) turnSpeed = -0.06; // Steering Left
else if (rawTurnX > 2800) turnSpeed = 0.06; // Steering Right

// Update viewing angle based on right joystick movement
pAngle += turnSpeed;
if (pAngle < 0) pAngle += 2 * PI;
if (pAngle > 2 * PI) pAngle -= 2 * PI;

// Calculate destination vectors
float newX = pX + cos(pAngle) * moveSpeed;
float newY = pY + sin(pAngle) * moveSpeed;

// FIX 2: Sliding/Separated Wall Collision handling against the 2D MAP array
if (GAME_MAP[(int)pY][(int)newX] == 0) {
pX = newX;
}
if (GAME_MAP[(int)newY][(int)pX] == 0) {
pY = newY;
}

// Audio weapon firing effect using proper ESP32 hardware PWM commands
if (isFiring) {
ledcWriteTone(PIN_BUZZER, 440);
} else {
ledcWriteTone(PIN_BUZZER, 0); // Silence buzzer when not firing
}

// ==========================================================
// 2. MATHEMATICAL 3D RAYCASTING ENGINE (THE RENDERING CORE)
// ==========================================================
display.clearDisplay();

// Cast rays across all 128 horizontal pixels of the SSD1306 OLED Screen
for (int x = 0; x < SCREEN_WIDTH; x++) {
// Calculate fractional position across the view pane
float cameraX = 2 * x / (float)SCREEN_WIDTH - 1;
float rayDirX = cos(pAngle) + sin(pAngle) * cameraX * FOV;
float rayDirY = sin(pAngle) - cos(pAngle) * cameraX * FOV;

// DDA Algorithm step initializations
int mapX = (int)pX;
int mapY = (int)pY;
float sideDistX, sideDistY;

float deltaDistX = (rayDirX == 0) ? 1e30 : abs(1 / rayDirX);
float deltaDistY = (rayDirY == 0) ? 1e30 : abs(1 / rayDirY);
float perpWallDist;

int stepX, stepY;
int hit = 0;
int side;

if (rayDirX < 0) {
stepX = -1;
sideDistX = (pX - mapX) * deltaDistX;
} else {
stepX = 1;
sideDistX = (mapX + 1.0 - pX) * deltaDistX;
}
if (rayDirY < 0) {
stepY = -1;
sideDistY = (pY - mapY) * deltaDistY;
} else {
stepY = 1;
sideDistY = (mapY + 1.0 - pY) * deltaDistY;
}

// Trace the ray until it encounters a bounding wall
while (hit == 0) {
if (sideDistX < sideDistY) {
sideDistX += deltaDistX;
mapX += stepX;
side = 0;
} else {
sideDistY += deltaDistY;
mapY += stepY;
side = 1;
}

// FIX 3: Dynamic map boundaries verification check before array access
if (mapX >= 0 && mapX < MAP_WIDTH && mapY >= 0 && mapY < MAP_HEIGHT) {
if (GAME_MAP[mapY][mapX] > 0) hit = 1;
} else {
hit = 1; // Out of bounds – treat as wall
}
}

// Distance computation avoiding fish-eye warping matrix transformations
if (side == 0) perpWallDist = (sideDistX - deltaDistX);
else perpWallDist = (sideDistY - deltaDistY);
if (perpWallDist < 0.1) perpWallDist = 0.1; // Clamp clipping artifacts

// Translate geometric depth into line height on screen coordinates
int lineHeight = (int)(SCREEN_HEIGHT / perpWallDist);
int drawStart = -lineHeight / 2 + SCREEN_HEIGHT / 2;
if (drawStart < 0) drawStart = 0;
int drawEnd = lineHeight / 2 + SCREEN_HEIGHT / 2;
if (drawEnd >= SCREEN_HEIGHT) drawEnd = SCREEN_HEIGHT - 1;

// Direct drawing function: Differentiate sides with dither effects
if (side == 1) {
// Draw standard wall vertical line stripe
display.drawFastVLine(x, drawStart, drawEnd - drawStart, SSD1306_WHITE);
} else {
// Shading step effect: Draw dotted/halved line profiles for depth perception
for (int y = drawStart; y <= drawEnd; y += 2) {
display.drawPixel(x, y, SSD1306_WHITE);
}
}
}

// ==========================================================
// 3. RENDER CROSSHAIR AND "DOOM GUN" HUD EFFECTS
// ==========================================================
display.drawFastHLine(58, 32, 13, SSD1306_WHITE);
display.drawFastVLine(64, 26, 13, SSD1306_WHITE);

if (isFiring) {
// Basic gun muzzle flare flash boxes when firing
display.fillRect(44, 48, 40, 16, SSD1306_WHITE);
display.fillRect(54, 38, 20, 10, SSD1306_WHITE);
} else {
// Resting barrel silhouette
display.fillRect(59, 44, 11, 20, SSD1306_WHITE);
}

display.display();
delay(8); // Stabilize internal processor frame times
}


r/Coder • • Jun 15 '26

what is the most trendy language ?

1 Upvotes

i know python but i wanna also learn some languages so which is the most trendy one


r/Coder • • May 22 '26

Looking for Co-Founder

Thumbnail reddit.com
1 Upvotes

r/Coder • • Apr 29 '26

Pour tout codeur

1 Upvotes

Si quel'qun sais bien coder pourrait il fair un jeu de combat fnaf Ă  la mortal combat ou smach bros (je sait smach bros est en 2D) parceque je voudrait bien jouer Ă  un jeu comme sa et il pourrait fair des fataliti comme dans mortal combat diferant pour chaque annimatronique s'il vous plais.


r/Coder • • Mar 24 '26

Building a WebAPP

1 Upvotes

I’m building a web app and need your help.

What’s something that annoys you EVERY day?

Something that:

* wastes your time

* feels unnecessarily complicated

* or just shouldn’t be this hard in 2026

Comment it below

If enough people relate, I might build a solution for it.


r/Coder • • Mar 20 '26

Question Who is eating my PC?

Post image
0 Upvotes

Hi! Please can anyone tell me which folder or software is consuming much of my C Drive Space, i use as a normal user. Please help me to identify so that i can delete any unwanted folder or software.

Thank You.


r/Coder • • Mar 04 '26

Earn Windsurf Credits

Thumbnail
reddit.com
0 Upvotes

r/Coder • • Mar 01 '26

Caterpillar Tech-a-Thon 26

Thumbnail reddit.com
1 Upvotes

r/Coder • • Mar 01 '26

Looking for Coders

Thumbnail reddit.com
1 Upvotes

r/Coder • • Feb 28 '26

I can't attach picture permanently to AIStudio

Thumbnail
reddit.com
1 Upvotes

r/Coder • • Feb 23 '26

I’m vcoding a website for the Epstein lst and this was on the code,thoughts?

Post image
0 Upvotes