Questions tagged [cpp]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
24 views

How to use PWM with DRV8870?

I'm using Arduino nano and I'm struggling working with the DRV8870 IC on PWM mode. When I use analogWrite(_pin, duty_cycle); the motor makes weird noises. I thought it's because of the PWM frequency ...
0
votes
1answer
24 views

String array length in function

I know this question has been asked a thousand times, but I can't find a solution for my case. I what to get the length of a string array in a given function. This is for an arduino board. #define LEN(...
1
vote
2answers
48 views

Nothing received from function returning array of strings

My read function returns an array of strings. i.e ssid and password String* configuration::read() { String rw_ssid = ""; String rw_pswd = ""; const int keys = 2; String read_ssid_pswd ...
0
votes
1answer
36 views

what is causing my esp8266 setup function to reinitialise?

Here is code I have written: #include <stdio.h> #include <ESP8266WebServer.h> #define MAX_WIFI_INIT_RETRY 50 #define WIFI_RETRY_DELAY 500 const char* wifi_ssid = "ssid"; const char* ...
0
votes
1answer
60 views

Getting error invalid conversion from 'const char*' to 'const uint8_t*

I have written this sketch, and I am trying to populate the array of wifi hotspots to set the value in html select using javascript dynamically. #include <Arduino.h> #include <Hash.h> #...
0
votes
1answer
33 views

trying to make wemos d1 code modular causes collect2: error: ld returned 1 exit status exit status 1

#include "connection.h" void setup() { Serial.begin(115200); Funcs::Connect conn; conn.connectWifi(); } void loop() { } then connection.h file: // connection.h namespace Funcs { class ...
-1
votes
1answer
47 views

How to respond dynamically by using File Containing Templates?

We are developing a Web Console and REST API for the NodeMCU V3 ESP8266, using ESPAsyncWebServer. We are facing some difficulties to serve dynamic pages using File Containing Templates! We're unable ...
0
votes
1answer
19 views

Update class attribute with attachInterrupt

I want to refactor this code /* YF‐ S201 Water Flow Sensor Water Flow Sensor output processed to read in litres/hour Adaptation Courtesy: www.hobbytronics.co.uk */ volatile int flow_frequency; // ...
1
vote
1answer
498 views

Using SoftwareSerial.h in .cpp file

I am trying to modularize the different components in my arduino build by using objects, but am having trouble with the one controlling a wireless transceiver, which uses SoftwareSerial.h I believe I ...
0
votes
2answers
626 views

WifiClient and aREST on esp32 - loop until new instructions recieved?

I've created a simple sketch for an esp32 that hosts a REST API that can be accessed via HTTP. Based on the instructions received from the client, the esp32 controls some neopixels with some various ...
1
vote
3answers
60 views

Guideline in library creation

According to this example, creation of an Arduino library is quite understandable. But a few things I would like ask (mostly regarding to what to be defined where) when a library is not that simple: ...
1
vote
1answer
1k views

getting error 'Serial' was not declared in this scope

I am adding Dust Sensor to my particle photon project at home, I got this GitHub project that I want to test before implementing a final code. I am not an expert in cpp, I wanted to modularise the ...
0
votes
2answers
2k views

How to store an RFID tag number in a string

I want to send RFID tag number to PHP page. So far I have sent a fixed string to php and it worked, now I am not getting data in string when i scan rfid tag. I want to store every RFID tag number in a ...
0
votes
1answer
130 views

Changing outputs infinitely for no reason

Im a student and working on a arduino project for IoT competition and me and my team have built a house and I made this code below. For some reason when I upload it to my Arduino MKR1000 it constantly ...