Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

154
Views
How can I let a c++ parameter decide what the HTML of the webpage will look like?

I'm working on a project in which I'm using a Walabot (a radar sensor) in c++. With this sensor I can detect if I wave my hand in front of the sensor. I'm also doing other stuff ofcourse with the sensor but that doesn't matter for this, but I need a webpage where I can show different things and I want to be able to 'swipe' in between them. I can detect the swipes in my c++ code but how do I translate this to HTML or javascript? The swipe can be made into a boolean or just a simple integer with the number showing which page I want to show.

In short: I want to pass an integer or boolean from c++ code to HTML/javascript and if that value changes it has to reflect aswell in the html, it can't be a static thing that only gets initialised in the beginning.

I saw something about nodejs but can't really see how that is supposed to make the value obtainable by the HTML. REST seems like a possibility too.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

In your c++ program, that's responsible for reading the radar output, you probably have a loop that constantly reads values from the radar. Add a timer and choose a time interval. In the loop, if the timer has reached the time interval, make it update a file with a label, telling you what event occurred most recently, e.g. a swipe, or if no even occurred.

In you JavaScript, make a loop that reads that file with the same time interval as it's updated by the radar program. Then, if the label in the file corresponds to an event, make the JavaScript take the appropriate action.

You could update the content of your page with functions like document.getElementById(), removeChild(), document.createElement(), and appendChild().

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!