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
2answers
76 views
Use PWM and ISR at same time on AVR
Is it possible to use AVR PWM outputs and ISR interrupts at the same time?
I've got a project I'm trying to do on an ATMega328P and I need 3 PWM outputs but ALSO need to be able to use ISR interrupts ...
1
vote
1answer
69 views
Using STL with ARM microcontrollers
I have an NXP LPC1769 which features an ARM Cortex M3.
I understand how to program it and have had success building both C and C++ programs for it.
I have some code that I want to port from Windows. ...
1
vote
2answers
138 views
C++ Standard Library on Arduino [closed]
Why can't I use std::string or any other objects from the C++ Standard Library in my sketches for Arduino? ...
2
votes
2answers
135 views
Understanding volatile class fields in AVR C++ programs
I'm having some confusion about what members to declare volatile in a program I'm writing in C++ for an AVR microcontroller, with interrupts. When it's plain C it makes sense - the compiler doesn't ...
-1
votes
0answers
26 views
How do I get a voltage on a PCIe Parallel Port? [migrated]
I'm trying to use a PCIe Parallel port from C++. (http://www.amazon.com/StarTech-com-Express-Profile-Parallel-PEX1PLP/dp/B004G7O2AC)
I can't seem to change the status of any of the registeres and my ...
0
votes
1answer
153 views
ATTiny 85 + shift register + ir sensor
I had the ATtiny working with the shift register, but when I added the IR receiver to the code the shift register did not work as desired.
I have a shift register connected to 8 LEDs and controled by ...
0
votes
0answers
73 views
v-usb HID button press and release
I'm trying to use v-usb on an AVR to mimic a HID keyboard and I found how to send keys and how to release ALL of them, by calling usbSetInterrupt() with 0 for the key value, but is there a way to ...
1
vote
0answers
60 views
ATtiny85 + shift register + IR demodulator [duplicate]
I had the ATtiny working with the shift register, but when I added the IR receiver to the code the shift register did not work as desired.
I have a shift register connected to 8 LEDs and controled by ...
1
vote
1answer
94 views
AVR Time Delay without Arduino Libraries
Trying to figure out how to do something like delay() in Arduino but just for straight AVR code. What's the typical way to do waits and such on AVR chips?
10
votes
3answers
286 views
Microcontroller Sleep Race Condition
Given a microcontroller that is running the following code:
...
4
votes
1answer
177 views
How to properly open and close files “inside” a member function? [closed]
I am using Arduino Uno and the Ethernet Shield with a 2GB SD Card. I have the following working code intended to be used to write data on the SD Card (note: the SD Library is properly initialized and ...
2
votes
5answers
132 views
Micro-Controller Programmable Selection
I have searched a lot and I can't seem to find a micro-controller that I can program in C++. Can someone please help me find a micro-controller (besides Arduino) that I can program C++?
-3
votes
1answer
74 views
Error: argument of type “cons char *” is incompatible with parameters of type “LPCWSTR” [closed]
I am writing a code in Visual C++ to access serial port of a computer.
Code is given below:-
...
1
vote
2answers
129 views
Problem on printing “Ethernet.localIP()” to Serial Monitor
I am using Arduino Uno and the Ethernet Shield. I have the following code:
...
-2
votes
1answer
103 views
How Can I Program a Universal Application Keyboard? [closed]
IMPORTANT NOTE: This is a question from who has no experience and knowledge on this area. So before giving negative rep, please provide constructive suggestion.
I want to program a universal ...
1
vote
1answer
212 views
Implementing the Digilent EPP
I am trying to implement Digilent Parallel Interface from their SDK. You can specifically read up on the interface in this manual. I am using the Basys 2 250k board.
I am trying to figure out what I ...
-1
votes
4answers
301 views
What are the pros/cons of C and C++?
What would be the pros and cons of using C++ over C for uC (AVR) programming ?
2
votes
1answer
200 views
Control a C program on a PC with external digital/analog inputs
I developed a code in DEV C++ which simulates graphically a the actions of a train driver. Basically I control the speed and some other functions of a train from my keyboard.
Now, instead of the ...
2
votes
1answer
256 views
New C++ (C++11) and embedded electronics
I wonder if the new C++ (which called C++11) works well with the embedded electronics and programming them. Do the new features fit well if working with uC? Like R-Values and so on? Or should be ...
13
votes
10answers
3k views
Programming languages for electronics engineers
I am an Electronics and Communications Engineering student, before I got to college, I have been interested in programming and computer applications. I had focused on designing Windows applications ...
3
votes
1answer
148 views
Custom-CPU builder/simulator
I googled deeply but couldn't find any cpu constructor simulator.
I'm specifically hoping to learn about the operation of the northbridge, but When I googled "bridge simulator" or "bridge (the ...
2
votes
1answer
998 views
How to program an ATmega32 in C++ to control a LCD?
I'm electronics student. I'm a newbie in programming. I have loved C++ after watching some videos on C++. Am using Atmega32 uC, WinAVR GNU GCC compiler programming tool, 16*2 Hitachi HD4478OU LCD for ...
5
votes
2answers
213 views
How can I instruct my compiler to use 8 bit bytes instead of 16 bit integers?
I have the following code in my microcontroler program:
...
7
votes
1answer
185 views
While loop optimized away
I have the following code in my microcontroler program:
// Wait for ADC conversion to complete
while ( ( ADCSRA && _BS( ADSC ) ) == _BS( ADSC ) ) {}
...
2
votes
2answers
378 views
C++ microcontroller/processor selection
I am having trouble selecting a microcontroller/processor for a robotics project in C++. I have a program working on my computer that is 1.5+ KLOC and relies on data in twenty other files to function, ...
1
vote
2answers
3k views
How to have an Arduino wait until it receives data over serial?
So I've wired up a little robot with a sound shield and some sensors. I'm trying to write a sketch that will let check the sensors.
What I'd like for it to do is print out a little menu over serial, ...
7
votes
1answer
417 views
Can an ATmega or ATtiny device signature be read while running?
While programming an ATtiny or ATmega, avrdude prints the device signature, in this example it is an ATtiny.
avrdude: Device signature = 0x1e910a
Can I read this ...
5
votes
5answers
1k views
Is it going to be possible to write code in C++ for PIC microcontrollers in the future?
Is it ever gonna be possible to use C++ for coding PICs? Is there any hardware limitations that prevents us to use C++? How much the size of generated .hex file and running time of the program ...
2
votes
1answer
898 views
What's wrong with my C++ Template code for Arduino?
I'm trying to implement a C++ templated member function in Arduino 0022, but I'm getting an error in code which seems correct to me.
...
10
votes
1answer
2k views
Arduino and Interrupts: Fast way to get pin values
I use an Arduino Uno and already set it up to work with interrupts on digital pins 2, 3, 4 and 5 according to an explanation1 I found.
void setup() contains the ...
1
vote
1answer
363 views
Cannot use HardwareSerial pointers or references in my Lib for Arduino AVR?
I wrote a wrapper class for a serial lcd screen for 4dulcd - and i want to be able to pass which serial i am using to communicate with it
I have these in my code
myClass.h
...
8
votes
3answers
490 views
C++ classes for I/O pin abstraction
I am looking for C++ abstractions for hardware I/O points or pins. Things like in_pin, out_pin, inout_pin, maybe open_collector_pin, etc.
I surely can come up with such a set of abstractions myself, ...
5
votes
2answers
439 views
MATLAB toolbox equivalent for embedded system
We have to develop control software to run in an embedded system. The prototype is made in Matlab (using neural network toolbox), and we want to port the software to C or C++. Do you know which ...
2
votes
1answer
2k views
Bug in Keil ARM compiler with interrupt handlers and C++?
I have a problem with writing interrupt handlers in Keil ARM compiler for LPC1114. When I write program in C++ and specify --cpp compiler option all code from interrupt handlers disappears, it is ...
6
votes
7answers
6k views
Programming a parallel port as digital I/O
I'm trying to use a parallel port from a computer as a form of cheap digital output to do various things (control motors, light LEDs, read limit switches, ect).
I want to know how to control the 8 ...
56
votes
14answers
13k views
Is C++ suitable for embedded systems?
A common question, here and elsewhere. Is C++ suitable for embedded systems?
Microcontrollers? RTOSes? Toasters? Embedded PCs?
Is OOP useful on microcontrollers?
Does C++ remove the programmer too ...
6
votes
1answer
1k views
What should I know when making a library for the Arduino?
It occurs to me that, beyond my current problem, I ought to ask, "What should I know when making a library for the Arduino?"
First, what I am doing:
I'm using Eclipse as my editor and writing code ...
