Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

159
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda