Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [c++]

C++ is a compiled general-purpose programming language that adds object-oriented features and other enhancements to the C language, which it is largely a superset of. It is popular for both embedded and PC software development.

-3
votes
0answers
32 views

ADC to PWM problem [duplicate]

everyone, I hope you are all are having a good time... I am trying to write the code that applies PWM on leds according to the reading of a POTENTIOMETER, I faced a problem that the leds' lights do ...
0
votes
0answers
27 views

COG PFC2119x driven LCD Display: Add custom characters, can get it to work

Story (skip if you want) Last week I received two malfunctioning DAB radio's from the 'brand' Tesco (type DR1551W) for free and because I cannot fix the problem with these units (missing service ...
-2
votes
0answers
57 views

Initializing object without copy constructor [closed]

I have the following options to initialize an object: Object* o = new Object(arg); This puts the object in the heap and returns a pointer to it. I prefer not to ...
0
votes
1answer
72 views

eeprom driver code c++ overlapping

im trying to write driver for EEPROM (24LC64): page size: 32 byte capacity: 8KB (64Kbit) definition code: ...
2
votes
0answers
80 views

Visual Studio and Structures [migrated]

I’m trying to port an application written for a micro to Visual Studio so I can more easily run the debugger and scan through the code, rather than debug on the chip which is a bit of a pain when you ...
3
votes
4answers
498 views

UART sometimes missing first few characters on ATmega328P

I wrote some code for the ATmega328P, (Packaged in a module that clones the Arduino Nano). Normally when I send UART data from my computer to these micros, it is received just fine. However I have ...
0
votes
1answer
91 views

Reading byte array in C++ [closed]

I have following code in C++ ...
0
votes
1answer
70 views

Why does making this change to my DHT11 code cause it not to work?

Note: This might not be a programming question. If it turns out that it is, I will close it. I am using an ESP8266 to build some air quality web servers. One of the sensors I am using is the DHT11 (...
0
votes
1answer
105 views

Call member function from interrupt in STM32 [closed]

I have created a new STM32 project using cube. I have changed main.c to main.cpp and enabled ...
1
vote
2answers
189 views

Combine C and C++ in STM32 application development [closed]

Generally, developing embedded systems applications is based on abstraction. We expose some functions from lower layers that can be used in the application layer. My question is: Can I develop the ...
0
votes
0answers
32 views

BLE Nano I2C on P0_10

I have a project where an nRF51822 (BLE Nano v1.5) is an I2C master and communicates with an Atmega328. I have communication working over I2C just fine using various pins. However, when attempting to ...
2
votes
2answers
477 views

How to read data from this sensor?

I am using the MLX90393 Magnetometer IC from Melexis. More specifically, I am using the breakout board by Sparkfun. I am still a beginner when it comes to programming, and this is my first time trying ...
0
votes
2answers
59 views

Map file analysis

I have been writing a software for an embedded controller in C++. I have noticed that I have some problems with ram memory (I have probably run out of the available memory). I have decided to inspect ...
3
votes
3answers
203 views

C to C++ How do I make h/w initialization look neat? [closed]

Doing an experimental conversion of some firmware from C to C++ to try and get a better structure in it, since the C code "evolved" in line with experiments across a 2 year period. The question is ...
0
votes
0answers
99 views

I don't understand the difference in data received between my C++ app, and XCTU/Realterm

I am new to coding in C++, new to wireless communication, and am self taught, so if you notice any mistakes not related to the problem please point them out as well! I have two XBEE series 1 attached ...
0
votes
1answer
211 views

MCP23017 with NODEMCU v3 (lolin) i2c doesn't work

I want to use NodeMCU v3 with MCP23017 that has MAX6675 at the end. Everything is on circuit please see the image. MAX6675 (U3) doesn't want to work with MCP23017. First MAX6675 (U4) works perfectly ...
5
votes
2answers
4k views

MCU programming - C++ O2 optimization breaks while loop

I know people says code optimization should only bring out the hidden bug in the program, but hear me out. I am staying on a screen, until some input via an interrupt is met. Here is what I see in ...
0
votes
0answers
250 views

Unable to post data in JSON format to ThingSpeak using ESP8266 thing dev board

I am trying to store data in json format and bulk update my ThingSpeak channel. The code below is just for test purpose to make sure JSON format works properly. However, after several tests I am ...
-1
votes
1answer
493 views

How to post multiple values to ThingSpeak?

I am able to store and access data in internal memory of RTC ESP8266 thing dev board. Now I am trying to loop the data stored in internal memory and post data to ThingSpeak. However, I am only able to ...
0
votes
1answer
152 views

How to fix the error “Response code 0” to get “Response code 202” to bulk update a thingspeak channel?

I am using this example: https://www.mathworks.com/help/thingspeak/continuously-collect-data-and-bulk-update-a-thingspeak-channel-using-an-arduino-mkr1000-board-or-an-esp8266-board.html According to ...
2
votes
2answers
190 views

How fast is mbed Digital Out

I need to output 8-bit integers via parallel (i.e. using 8 pins on the same port) at 1024hz. From what I can see, I have two options: 1) Write to each pin individually using DigitalOut. 2) Avoid the ...
0
votes
1answer
131 views

C++ RTOS Options [closed]

What are some off the open source, popular choices for a C++ compatible RTOS (besides mbed)? I've heard that FreeRTOS doesn't provide official support for C++ compilation and it's a nightmare getting ...
0
votes
0answers
70 views

SPI SD card returns R1 0x01 and all zeros for the other 32 bits of data to CMD8

I've been trying to get my SD card adapter to work with SPI, and I've come quite a way since starting. I've been following allong with this very useful answer. However, when sending CMD8, I get 0x01 ...
0
votes
0answers
58 views

Using C++ objects within FreeRTOS Tasks

I'd like to make use of object-oriented practises inside a FreeRTOS application. Is this as simple renaming files with task functions as .CPP, and instantiating objects, etc. inside the function, ...
0
votes
2answers
107 views

Microcontroller support strings or other libraries [closed]

I heard some microcontrollers have a poor (or no) support for <string>s as a data type of C/C++ when programming. How to know if a microcontroller supports <...
1
vote
3answers
157 views

Is “new” acceptable when using C++ objects in a FreeRTOS application?

I've read that malloc() should be avoided when designing FreeRTOS applications. Does the same apply when using "new"? E.g.: TestObject* test = new TestObject(); ...
1
vote
1answer
182 views

STM32F3 CAN Hardware not Entering Init Mode

I'm trying to write a bare metal driver for the STM32F302 on a Nucleo-64 board. I'm having trouble getting past the very first steps and getting the hardware to set the Initialization Acknowledgment. ...
1
vote
2answers
127 views

Estimating the frequency at which your microcontroller is running

I have recently started programming an ATtiny85 microcontroller, which as per the datasheet runs at 10Mhz given 3v3 supply. So, to experiment, I have created a small program, as shown below. ...
1
vote
1answer
316 views

hamming burst error detection [closed]

I want to use Multiple Bit Error Detection and I have read a lot of sites but no one shows how to implement it using code and how the receiver performs the error correction to the received data. The ...
1
vote
1answer
807 views

SIM800L AT+CSQ return 0,0 when SIM is inserted and 20~40 when I insert the sim

I have SIM800L module, when I try AT+CSQ it returns 0,0 when I tried to remove the sim and try again it returns number, 0 (25,0) and I cannot register to a network so AT+CREG? returns 0,2 should ...
0
votes
1answer
296 views

C++ - Help Interpreting the instructions of a CRC error-checking programming assignment

This is unconventional, based on what I've seen, but I can't get a hold of my professor's aides to clarify this assignment. I hope this is still ok to post here. I would greatly appreciate some help ...
0
votes
0answers
163 views

libmodbus modbus_read_bits() returns illegal function

It is all okay when it comes to read registers with: modbus_read_registers(ctx,0,32,destination); It gives me values of 32 different registers. But when it comes ...
1
vote
0answers
583 views

STM32F407VG DISCOVERY BOARD micro controller CAN messages

I am wondering if anyone is familiar with any STM32f407VG micro-controllers? If so, I am having some problems configuring a CAN driver. I can run the demo code, which is set to a loop-back mode, but ...
0
votes
2answers
687 views

Serial bi-directional (one-wire half-duplex) digispark device works however answers itselfs

I followed this guide to create an one wire bi-directional (debug) device for a Digispark (Attiny85): https://digistump.com/wiki/digispark/tutorials/debugging (see section Bi-directional Serial ...
0
votes
1answer
60 views

Esp8266 header file code interpreat

Currently I am working in a project on esp8266 and before getting into the project I started to read the library and in a section I found something which has no meaning to me. I need help on that <...
0
votes
1answer
44 views

Cypress FX3 CyU3PToolChainInit Understanding help

I don't understand the purpose of the CyU3PToolChainInit function that is written in assembly source code for the FXE. As for as I know it clears the BSS area and enters the main function, but how is ...
1
vote
0answers
76 views

Reading multiplexed or charlieplexed display, is it possible and how?

What I try to do is reading a 7 pin display with 35/36 segments/LEDS. I want to do this to know what the device is doing. Why? Because I want to know I can do it (it is possible anyway) and to be able ...
4
votes
3answers
324 views

smt32 f10x invalid characters over uart

I'm currently working on a quadcopter using the STM32F103. Instead of using the provided Std Periph Driver which is big I'm creating my own Periph Driver which is object oriented which also helps me ...
0
votes
1answer
1k views

How to correct Warning : array subscript has type 'char' [-Wchar-subscripts] [closed]

Hi I write a function to reset a Character Array in Atmel studio as below: ...
0
votes
2answers
156 views

24 tooth input to simulate 36 output

Can someone please help me with code? I have a 24 teeth trigger wheel. Every tooth is registered by hall sensor and I need that Arduino simulate 36 pulse output of that corresponding 24 pulse input. ...
1
vote
1answer
109 views

Porting Arduino library to msp430

I am working on a project that uses msp430G2553 as the main microcontroller. I bought an LCD from here https://www.adafruit.com/product/2088 but its libraries are all written for Arduino. Has anyone ...
0
votes
1answer
33 views

Help Led matix isn't lighting up correctly Is it a Hardware or software issue? [duplicate]

I am trying to reverse engineer the project from this video: https://youtu.be/zc1zbwheyE0?t=50s. From the video a visible 10 wires are going from the LEDs to the Arduino mega, i am assuming that they ...
5
votes
1answer
757 views

Arduino - Writing to a 3½ floppy disk

I found some old, still working 3½ floppy drives using the 34-pin IDC interface, that will take a 1.44 MB disk. I had a project in mind, using these floppy disk as an "access key" for a door. In order ...
1
vote
0answers
2k views

Cannot send SMS with SIM900 GSM module

I have a little problem using GSM SIM900 module connected to the Arduino the call is working alright but it doesn't send me SMS I don't know why. This is my code: ...
0
votes
0answers
38 views

XBee | Ubuntu (C/C++) | Android

I am looking for guidance of wireless communication between Ubuntu (code written in C/C++) with an Android device. Since the desired range is about 1 mile (~1.5 km), I assume that XBee Pro would be a ...
10
votes
2answers
2k views

Version control of schematics and source code

I am developing an electronic device which has two parts: hardware (Eagle schematics) and firmware (C++ source code). I would like to track changes in both source code and schematics, but there are ...
0
votes
1answer
1k views

Confusion about ADR in ARM (assembly code)

I'm confused on what's happening with ADR R14,cnt1. Is cnt1 signifying the end of the program? And if so how will ...
6
votes
1answer
2k views

STM32 interrupts and C++ don't go well together [duplicate]

I set up TIM3 to fire an interrupt in my project and it just wouldn't work. I tried everything I could and still couldn't find whats the problem. Then I created a clean project and copy/pasted only ...
-1
votes
1answer
188 views

Understanding LED chaser code for PIC18F4550

I want to make a LED chaser from right to left in PIC18F4550 microcontroller. Here is a section of the code from a program which I am unable to understand: ...
-1
votes
1answer
142 views

access variable within ISR? [closed]

I am currently counting steps of the movement of my stepper motor in a ISR, but cannot figure out where i should read in the incremented value (step_count) for ...