Stack Exchange Network

Stack Exchange network consists of 175 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.

0
votes
0answers
16 views

generate log .txt file on PC for arduino serial terminal log (send and receive commands)

I am trying to generate a .txt file on my Windows 10 PC of Arduino serial terminal data. I am not using SD card on Arduino Mega board just need to send commands to Arduino baord from serial terminal ...
0
votes
0answers
25 views

WS2811 flicker to random colors when trying to turn them all off in a 3x3 array

I am trying to do more, but for starters, I am trying to write code to turn all of my WS2811 off that exist in a 3x3 array. Currently, when I run my Arduino project, they are flickering from red, to ...
0
votes
1answer
62 views

STM32L432 full duplex DMA SPI slave locks up after communication starts

I am continuously sending a substantial amount of data between the STM32L432 and a FPGA using SPI in full-duplex mode. I decided to implement DMA on the L432 in order to increase the transfer rate ...
0
votes
0answers
72 views

Why I can't change variable in it.c?

I have stm32vldiscovery project. I want to use external interrupt by PA0 (user button). When I press the button (PA0), then function EXTI0_IRQHandler must set ldOn equal 0. But ldOn always is 1. ...
1
vote
1answer
58 views

SAM Timer counter / atmel ASF

I'm trying to implement function call after having timeroverflow or comparison of counter registers. Chip: SAM4E ...
0
votes
0answers
54 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 ...
0
votes
1answer
78 views

eeprom driver code c++ overlapping

im trying to write driver for EEPROM (24LC64): page size: 32 byte capacity: 8KB (64Kbit) definition code: ...
3
votes
4answers
548 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 ...
1
vote
1answer
99 views

Reading byte array in C++ [closed]

I have following code in C++ ...
0
votes
1answer
97 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
178 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
348 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
34 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
610 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
72 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
225 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
1answer
310 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
293 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
818 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
269 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
217 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
178 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
85 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
93 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
113 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
182 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
207 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
133 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
340 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
1k 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
317 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
182 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
637 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
748 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
65 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
45 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
80 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
380 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
2k 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
167 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
119 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
789 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
41 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 ...
1
vote
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
210 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: ...