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.

0
votes
1answer
50 views

Call member function from interrupt in STM32

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

Combine C and C++ in STM32 application development [on hold]

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
29 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
410 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
54 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
183 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
98 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
128 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
187 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
273 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
74 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 ...
1
vote
2answers
158 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
104 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
62 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
38 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
98 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
136 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
158 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
121 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
282 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
626 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
259 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
147 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
528 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
613 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
41 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
75 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
267 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
144 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
99 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
701 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
37 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
991 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
175 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
138 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 ...
0
votes
1answer
249 views

Accelerating a stepper motor without it making noise [closed]

I am having some issues moving my stepper motors without it making noise. I read somewhere that ramping the frequency of the pulse modulated signal would help, but seems to have same issues as well. ...
2
votes
0answers
439 views

How do I change the PWM frequency on an Arduino Uno

I currently trying to change the PWM frequency from the the standard 490 Hz to something else, Literally something else. I previously used a timer1 library ...
2
votes
3answers
376 views

Are virtual-functions called at a high frequency suitable for embedded systems?

I have a (reasonably powerful) 32-bit MCU. Would it be unwise to design my system using OOP principles - mainly virtual methods? I have a virtual method which would be called around 1000/second. ...
0
votes
1answer
62 views

Does this piece of code follow the required timing constraints?

I trying to interface with an stepper motor driver board (ST330-v3 - page 7) Timing diagram from the datasheet: The board need sequence of signals, which i tried create by this code. but aren't sure ...
2
votes
1answer
188 views

How to read/write from a CPU using a usbWiggler?

Reading the Macraigor API for the usbWiggler MacraigorApi_ JtagScanlO ...
-1
votes
2answers
91 views

Can we control our computer's USB port? [closed]

what i want to do is : I want to connect a USB fan to my laptop and through programming want to turn on and turn off the fan. Is it possible to do so? Please post your valuable suggestions.
1
vote
0answers
318 views

No output for C++ GPIO code for beaglebone black

could anyone tell what could possibly be wrong in the following C++ code for enabling and setting pin no 49 (p9_23). I am directly checking the output on multimeter. ...
0
votes
3answers
567 views

Linker error using Atmel Studio with C++ project

I have created a simple C++ project using Studio 7.0.1006. Then using "Add Class", I added a simple class called CGPIO. To this class I added a public method called Initialize. The code compiles and ...