r/programminghelp • • Aug 07 '25

C++ Arduino IDE code not working! MAX30100 sensor unable to send readings

4 Upvotes

tried using this code to send readings from Max30100 sensor to esp32 but readings dont show on serial monitor, already installed libraries and checked wiring. We are trying to measure heart rate ONLY to send to an app. no bluetooth yet

#include <Wire.h>
#include "MAX30100_PulseOximeter.h"
#include <WiFiClient.h>
#define REPORTING_PERIOD_MS 1000


PulseOximeter pox;

uint32_t tsLastReport = 0;


void onBeatDetected(){
  Serial.println("Beat!");
}


void setup() {
  Serial.begin(115200);
  Serial.print("Initializing pulse oximeter..");


  if (!pox.begin()) {
    Serial.println("FAILED");
    for (;;) ;
  } else {
    Serial.println("SUCCESS");
  }


  // Set the heartbeat detection callback
  pox.setOnBeatDetectedCallback(onBeatDetected);
}


void loop() {
  pox.update();


  if (millis() - tsLastReport > REPORTING_PERIOD_MS) {
    // Print to Serial
    Serial.print("Heart rate: ");
    Serial.print(pox.getHeartRate());
    Serial.print(" bpm / SpO2: ");
    Serial.print(pox.getSpO2());
    Serial.println("%");
    tsLastReport = millis();
  } 
}

r/programminghelp • • Jun 05 '25

C++ Jolt Help?

Thumbnail reddit.com
4 Upvotes

r/programminghelp • • May 15 '25

Python How can Python help me?

4 Upvotes

Hello everyone I'm 18M,

I'm from Social Science and Humanities background.

I'm thinking of pursuing Mass Communication in further but I'm also interested in research things. I'm aiming to look for job in Japan in future so I wanted to know how can Python help me in that? What job opportunities i can get after learning python, having a degree in mass communication, having a media working background? Also I'm working on a research project — that's related to media psychology.

Please help me out if learning python would be worth it for me or not and can help me get better jobs other than just from a degree.


r/programminghelp • • Mar 15 '25

C++ c++ : "filesystem" was not declared in this scope

4 Upvotes

error: 'filesystem' was not declared in this scope; did you mean 'system'?

#include <iostream>
#include <filesystem>
#include <fstream>

int main() {

    std::cout << "Current working directory: " << std::filesystem::current_path() << std::endl;

    return 0;

}

I've tried adding using namespace std that didn't help either. I have g++ 13.2.0 and CLang 16.0.0.

iostream and fstream are working, filesystem is not.

Thank you in advance.


r/programminghelp • • Dec 11 '24

Python Can someone help me fix my functions?

4 Upvotes

Hello! Warning, I am working on a bunch of assignments/projects so I might post quite a bit in here!

I'm a beginner programmer who is not very good with functions. I will try to post an image of what the program's result is meant to look like in the post's comment section. I have the requirements for each function commented above their def lines. I think my main issue is calling the functions but I am not sure how to proceed from here. Can someone help point me in the right direction? Thank you!

https://pastebin.com/5QP7QAad


r/programminghelp • • Aug 19 '24

C++ Troubleshooting MSYS2 Installation Error

4 Upvotes

I've been encountering issues with installing MSYS2 on my Windows 11 machine. Below is a summary of the error and the troubleshooting steps I’ve taken so far.
Error message:

Error during installation process (com.msys2.root):
Execution failed (Unexpected exit code: 254): "C:/msys64/usr/bin/bash.exe --login -c exit"

After opening MSYS2 ( I get a broken install ):

Error: Could not fork child process: Resource temporarily unavailable (-1).
DLL rebasing may be required; see 'rebaseall / rebase --help'.

What have i tried:

  • Disabling Antivirus during installation

    • Set-MpPreference -DisableRealtimeMonitoring $true

  • Tried Running the Installer as Administrator

  • Attempted Installation in Safe Mode

  • Uninstalling WSL

  • Removing conflicting PATH variables

  • Removing all applications apps like git bash.

  • Tried running autorebase.bat ( throws a fork error )

  • Tried using ./dash.exe -c "rebaseall"

  • Tried ./pacman -S mingw-w64-x86_64-rebase

  • Generative AI screwing up my mind

  • Didn't try boozing up yet

Thank you for your time and energy <3

EDIT:

Fixed by turning off Windows defender ASLR (Address space layout randomization).


r/programminghelp • • May 29 '24

Project Related Can anyone recommend me a flow chart programme?

4 Upvotes

I’m planning on building a mind map to connect all the different and side quests that connect to each other in a video game I love. Can anyone recommend me a programme to help map it all out?

The requirements needed are;

Large amount of node space

Creating squares to separate clumps of nodes based on being in the same area or related to a particular faction

Possible colour differentiation


r/programminghelp • • Mar 13 '24

Project Related CORS Errors with React App configured on AWS Load Balancer and Nginx server

4 Upvotes

I have a react front-end running on Port 3000 of my ec2 instance. We have an nginx reverse proxy that redirects all traffic from port 80 to port 3000. I have a FastAPI backend that runs on port 8009 and runs from api.mydomain.com which is configured through an AWS load balancer. The nginx.conf file has all CORS headers correctly configured. Yes, we've added Content-Type and allow OPTIONS etc.This is how it looks when we curl it -

date: Wed, 13 Mar 2024 04:34:19 GMT

content-type: application/json

content-length: 31

server: nginx/1.24.0

allow: POST

access-control-allow-origin: [https://paradigmaisummarizer.com](https://paradigmaisummarizer.com)

access-control-allow-credentials: true

access-control-allow-methods: GET, POST, OPTIONS, PUT, DELETE, HEAD

access-control-allow-headers: Authorization, Origin, X-Requested-With, Content-Type, Accept

Yet, sometimes, randomly, our website will start getting CORS errors saying that we have no CORS headers. The solution to this is never consistent. Sometimes reloading the page and trying again does the trick. Sometimes we have to re-run nginx again using systemctl. Sometimes we have to take down the python and react app and restart both from scratch. Sometimes, we just wait for thirty minutes and it starts working again. We want a permanent solution that isn't so erratic and random. We were wondering if anyone here had ever seen something like this and knew how to fix it. I can provide our nginx.conf or other code if required.


r/programminghelp • • Jan 24 '24

C help i need colors in c/c++

4 Upvotes

i am writing a program in c and i want get colored text. i donot want to use the system("color 0a") type method and ansi codes are not working. for example ansi code for red is \x1B[31m but the console outputs it as an arrow+[31m. i am using windows 8.1 and dev c++. i need colors like the way u can get by using colorama module in python.


r/programminghelp • • Dec 10 '23

PHP Just finishing up 1st semester of software dev, I don’t think I can do this as a career

4 Upvotes

I can’t even do the projects, my group helps a ton and my tutor helps me get my shit done but fuck man I don’t get anything. Nothing sticks


r/programminghelp • • Sep 10 '23

Python Python- how to get the file size on disk in windows 10?

4 Upvotes

I have been using the os.path.getsize() function to obtain the file size but it obtains the file size as opposed to the file size on disk. Is there any way to obtain the file size on disk in python? Thank you.


r/programminghelp • • Aug 12 '23

Career Related Does where you get your degree from matter to employers?

4 Upvotes

So my job has free college for employees. I wanted to go to school for a CS degree from ASU, LSU or the university of Florida as I know those schools. When I called an advisor they tried getting me to apply to online universities I’ve never heard of before. When I looked them up I saw tons of bad reviews from students. Does the school you get a CS degree help you land a job? Do employers care if I got a degree from Penn Foster College? It’s completely free


r/programminghelp • • Aug 08 '23

Other Wanna start to learn programming (for the 3rd time)

4 Upvotes

So in the past ive tried to program 2 times (1 in school and 2 self taught) and i wanna get back into it again since the first two i didnt really have the dicipline to do so. So i wanted to share my work flow idea which was just watching the youtube channel FreeCodeCamp and taking notes. What can i improve on my work flow and what can my work route be to make me learn programming and sorta understand the roots.

Thanks for reading <3


r/programminghelp • • Aug 02 '23

Java How to save the last RANDOM generated number in a loop

4 Upvotes

I am trying to make the user go back to the position he was on if he gets higher than 100.

So if he was on 97 and rolls a 5 on Dice1 and becomes 102, I want the variable position1 to go back to 97 . I am still new so it might just be a stupid logic problem

import java.util.Random;

import java.util.Scanner;

public class Main{

public static void main(String[]args) { 
	
     Scanner Scan = new Scanner(System.in);
     Random random = new Random();
     int Position1 = 0;
     //int position2 = 0;
    
     
     System.out.println("Type Start");
     String Input = Scan.next();

  
	  if (Input.equals("start")){
		 
		 while(Position1!=100 ) {
			
			 int Dice1 = random.nextInt(1,7);
			
 
			 if (Dice1 == 6) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1);
				 System.out.println("player 1 turn ");
				 Input = Scan.next();

			 }
			 else if (Dice1 == 5) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1); 
				 System.out.println("player l turn");
				 Input = Scan.next();

			 }
			 else if (Dice1 == 4) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1);
				 System.out.println("player 1 turn ");
				 Input = Scan.next();

			 }
			 else if (Dice1 == 3) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1);
				 System.out.println("Player 1 turn");
				 Input = Scan.next();

			 }
			 else if (Dice1 == 2) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1);
				 System.out.println("player 1 turn");
				 Input = Scan.next();

			 }
			 else if (Dice1 == 1) {
				 Position1= Position1+Dice1;
				 System.out.println(Position1);
				 System.out.println("player 1 turn ");
				 Input = Scan.next();
			 }
			 if(Position1>100) {
				Position1 = Position1-Dice1;
			 }
			 else if(Position1==100) {
				 System.out.println("U Win"); 
				 
			 }
				  
			
	  
	 		 
			 
			 
			 		 
			
		}
		
			
		 
	}

	
}

}


r/programminghelp • • Jun 11 '23

Project Related How do I stop my apps from being flagged as a virus?

4 Upvotes

This happened to me with C++ and Python, whenever I make an .exe and try to share it, it gets flagged as a virus.

I looked it up and it said I need a license and the only simple and possible ways to get a license cost money.

Is there any way to get a license for free and attach it to my .exes? My files are safe of course.


r/programminghelp • • May 20 '23

Other What programming language should I start with?

4 Upvotes

I'm pretty new to programming and I just don't know where to start. Any recommendations are highly appreciated!


r/programminghelp • • May 08 '23

C Where is ASCII saved?

4 Upvotes

My question is, where does the computer know ASCII? Like is it installed somewhere so I guess my question is how does the computer know how to translate zeroes and one’s into letters using ascii? Like where is that in the computers memory? I may be asking this question wrong but hopefully I explained it clearly, I’m currently taking CS50. For example, the letter “A” is 065 on the ASCII chart, how does the computer know this? Is it preloaded into the bios? Or where is it put? Let’s say I’m the first person to make a computer and we all agreed on ASCII, how is this then put into the computers brain?


r/programminghelp • • Mar 28 '23

C# NotePad++ Plugin - ANSI vs UNICODE

4 Upvotes

I'm trying to create a NotePad++ plugin using the Notepad++ plugin pack .NET (https://github.com/kbilsted/NotepadPlusPlusPluginPack.Net) and using C#. I am using v8.4.8 of NPP.

When I open NPP or try to debug my c# program it alerts me that:

This ANSI plugin is not compatible with your Unicode Notepad++.

I do understand that the .NET plugin pack requires the plugins to be UNICODE, however I have no idea what makes the plugin that I'm developing UNICODE vs. ANSI.

  • Is there some UNICODE vs ANSI setting somewhere in Visual Studio?

  • Is there something else that I may be doing that makes my plugin program considered ANSI?

  • My project references and uses functions from a.NET dll which I do not have the source code for (I'm combining the assemblies with ILRepack, per info I've found on the internet that indicates that NPP doesn't do well finding dll's external to the plugin itself). Is there something in this external dll that may be making the overall plugin to be considered ANSI? Is there something I can look at in that dll to see it's UNICODE vs ANSI info?

Any help or breadcrumbs in the right direction would be greatly appreciated.

EDIT: Moments after posting this, I was able to find a hint from the internet (even though what seems like 100s of previous searches were dead ends...). The dll that I was using took a string as an input. If I convert that string to UTF8, then it no longer is upset about UNICODE vs. ANSI. I do have other problems, but this issue seems to be resolved.

byte[] bytes = Encoding.Default.GetBytes(myString);
myString = Encoding.UTF8.GetString(bytes);

r/programminghelp • • Nov 23 '22

R Eli5 how can people code a coding software? When the first coding “language” was created. How did they code that if there was no other language to code the new language

4 Upvotes

I didnt know where to post this, in r/explainlikeimfive it got removed and in r/programming it wasnt possible. Idk where else to post this


r/programminghelp • • Nov 22 '22

Other What is a .Net developer? Is .Net a language?

4 Upvotes

Hey all,

What is a .Net developer? I've been browsing the job listings online for a developer role (currently studying Java but wanted to see what the market is demanding). Every job post is .Net developer needed etc.

What is that exactly? I know I'm not on ELI5 sub, but I'm very new to programming/coding whatever the proper term is and I am trying to wrap my head around all the technologies/terminology.

Thanks,


r/programminghelp • • Nov 04 '22

Answered Second print works as intended but first doesn't?

4 Upvotes

I have a reverse function and i just want to know why my first line isn't reversed but my second one is.

code:

def reverse(str_to_reverse):

for x in str_to_reverse:

str_to_reverse = str_to_reverse[::-1]

return str_to_reverse

print(reverse("This is a string"))

print(reverse("Hello World"))

Output:

This is a string

dlroW olleH


r/programminghelp • • Sep 06 '22

Java My code gives errors and does not work. I tried to fix it, but i couldn't.

4 Upvotes

https://privatebin.net/?699a26f314cae086#7J8EHrFDChSoX98VFgYg61JLUWffospSiwaZv8R7psUS is my code.

The errors are all "Cannot use this in a static context" on lines 16,17 and 19. I tried removing the "static" part but it did not work.


r/programminghelp • • Sep 06 '22

C++ [C++] How do you use recursive functions in programs? Any advice?

4 Upvotes

I've been trying to use recursive in my project, but I have no idea how could I include it on an app (?)

I don't have a code since I don't even know how to start. I've tried with addition and subtraction, things like that. But, for example, an app where you have to login, etc. it just feels like it doesn't fit in.

So, that's why I was asking for an advice. ;;


r/programminghelp • • Jul 20 '22

C++ I'm having a problem

4 Upvotes

I could use a little help. I keep getting an error in my code, with my third class. It says unknown type name 'employer'. Do you have any solutions?

This is my code.

#include <cstdlib>
#include <iostream>
#include <string>
#include <vector>
#include <fstream>
using namespace std;
int option;
void menu(){
cout<<"Welcome to the address book Menu"<<endl;
cout<<"1.Add personal Information"<<endl;
}
class Personalinfo{
private:
string name;
int age;
int number;
vector<string> Records;

public:
friend class person;

};
class person{
public:
void add(Personalinfo Ob){
ofstream nijonfile;
nijonfile.open("Objects.cpp");

cout<<"Enter your name"<<endl;
cin>>Ob.name;
cout<<"Your name is" << Ob.name <<endl;
nijonfile << Ob.name <<endl;
Ob.Records.push_back(Ob.name);
for(int i=0; i<Ob.Records.size();i++){
cout<<"Your info is" << Ob.Records[i] <<endl;
}

}

void luffy(Employer HP){

cout<< HP.hours <<endl;
}

};

class Employer{
private:
int hours = 11;
public:
friend class person;

};

int main(){

Personalinfo ob1;
person ob2;
ob2.add(ob1);
Employer HP1;

}