14
votes
How can Arduino's 8 bit Microcontrollers handle C++
It's a misconception that using constructors or C++ in general requires lots of RAM. Plus, to be clear, the AVR processors like the Micro and Uno have separate RAM and PROGMEM (program memory). So, ...
10
votes
Arduino Micro vs. Pro Micro
I actually think you are meaning what is the difference between the Arduino Mini and the Arduino Pro Mini, since there is no such board as the Arduino Pro Micro. However there is a board called the ...
6
votes
Accepted
Unexpected negative values from abs() function inline with analogRead
abs() is defined in Arduino.h as a macro:
#define abs(x) ((x)>0?(x):-(x))
A macro does not evaluate in the same way as a function.
sensor = abs(analogRead(A0) - 512);
This statement will be ...
6
votes
Accepted
Arduino Micro 5V Vin and 3v3 pins
Vin is a power INPUT. It is connected to the input of the voltage regulator, which enables you to power the Arduino with voltages between 6V and 12V, while the Arduino itself is running on 5V.
The 5V ...
5
votes
How can Arduino's 8 bit Microcontrollers handle C++
The talk about C++ being incompatible with small MCUs implies that developers would use features it provides. In a good C++ project you're expected to use vectors and iterators instead of C arrays, ...
5
votes
How can Arduino's 8 bit Microcontrollers handle C++
C++ is fine with Arduinos or other AVR based Systems.
I've been use it for quite a while in a home automation project.
The avr runtime does not support exceptions nor dynamic memory allocation, as ...
5
votes
Accepted
What does a tilde (~) mean as annotation for a data pin?
It means the pin can be a PWM output for use with analogWrite().
4
votes
Accepted
Use lowpower-libary and still use serial connection and other things
Yes, activating low power does disable the UART - but only while it's sleeping.
To use serial you just need to ensure that you only use it while it's not sleeping - and due to the interrupt and ...
4
votes
Accepted
Square wave generator generates a shorter pulse from time to time
There are two issues here:
There is a data race on counter[]: it can be modified in interrupt
context while it is being read (or even modified) by the main
program.
Clearing counter[y] will make you ...
3
votes
Accepted
Why is the T2 transistor used in Arduino Micro?
T1 and T2 implement a power supply ORing of the VUSB and VIN voltages. Read this for extended information.
The body diode of each MOSFET performs the basic ORing function. When the MOSFET is turned ...
3
votes
Accepted
Stopping Serial on RX/TX pins while running Serial on USB
The Serial and Serial1 are two seperated ports. They are not connected. The Serial is the USB serial and does not use pin 0 and 1 at all. The Serial1 is the hardware serial port at pin 0 and 1, but if ...
3
votes
Is there any way to use the serial port as an interruption source?
Use millis() for the timing of the temperature reading, then you can read from the serial in between time and won't need to use any interrupts.
unsigned long last_measure = 0;
const byte buffer_size ...
3
votes
Accepted
Arduino-based mains frequency monitor follow-up
You should remove the capacitor. It won't remove any DC offset because there can be no DC offset. From where would the DC offset be relative? There is only two points in the circuit, and both of them ...
3
votes
Accepted
Arduino keypad and RF 433MHz transmitter problem
The problem is you send a character of type char, thus exactly one byte.
However, when you send it you have to give the length and you use strlen. However, msg is an array (at least that is what you ...
3
votes
Accepted
What is the smallest duration that can be measured using micros()?
What is the least value of time that I could measure(count) using micro() in Arduino board?
The answer is 64 clock cycles or 4 us @ 16 MHz. Please see the Arduino AVR core[1] for more details.
...
3
votes
Emit region-neutral keyboard signals
No. There is no such facility.
If you take a German keyboard and plug it into a US configured computer the key layout will be wrong. You have to tell the computer that you're using a German keyboard.
...
3
votes
Emit region-neutral keyboard signals
Download Device Class Definition for Human Interface Devices (HID)
https://www.usb.org/sites/default/files/documents/hid1_11.pdf
See section 6.2.1 HID Descriptor
bCountryCode 0x09 German
also see ...
3
votes
Accepted
Software I2C - sending data
The main problem seems to be, that you are not adhering to the MCP's communication protocol. You just try to directly and only send the pure analog measurement to it.
Look at this image from page 18 ...
3
votes
Accepted
STM32 as keyboard
The STM32F105xx series is not yet supported by either Arduino core (STM32 core or maple core) and neither mbed-os.
The chip is still usable with the STM32 provided framework, the STM32HAL, (e.g. ...
3
votes
Accepted
Why wont my custom Arduino-Micro-based board connect over USB?
Well I finally found the source of the problem, many thanks to everyone here who helped me narrow things down and kept pointing me in the right direction. After figuring out that D+ and D- were ...
2
votes
Arduino IDE COM Port error on Windows 10
An easy thing to try but might not help: Use another USB port of your computer and see if the driver is reinstalled.
Otherwise, go to control panel and find the drivers (Device Manager), search for ...
2
votes
Programming Arduino Micro via RX/TX
RS-232 logic uses a negative voltage typically from -3 to -25V to represent a logical high and a positive +3 to +25V to represent a low. On the flip side TTL used on the AtMega uses +5V or +3.3V as a ...
2
votes
Accepted
How to program Fio v3 without MicroUSB port
The board runs at 3.3V, so you can provide 3.3V directly into the 3.3V pin on the side. Also the black connector next to the USB socket is a battery connection for a Li-Ion battery or similar. It will ...
2
votes
Accepted
What bootloader does the Arduino Micro come with?
Try looking at https://github.com/arduino/Arduino/blob/master/hardware/arduino/avr/bootloaders/caterina/Descriptors.c
Inside that is:
/** Device descriptor structure. This descriptor, located in ...
2
votes
Stopping Serial on RX/TX pins while running Serial on USB
There is no real reason why it should be tied somehow. And running simple test program seconds that:
void setup() {
pinMode(0, OUTPUT);
pinMode(1, OUTPUT);
Serial.begin(9600);
}
void loop() {
...
2
votes
Accepted
Trigger countdown with 433MHz transmission
You say The full code includes some differentiation mechanism for all sensors so I'll assume there's some function GetSensorId() that returns 0 to NUM_SENSORS - 1.
So, you need to keep track of a) ...
2
votes
Why is the T2 transistor used in Arduino Micro?
It's known as a "zero drop-out diode". When the power is first applied the body diode of the MOSFET conducts and powers the system. That imposes a (roughly) 0.7V drop on the input voltage.
Once the ...
2
votes
Arduino Pro Micro not recognised by computer or showing up in ports
The arduino pro micro is notoriously difficult to program. I am sure you have figured this out when first installing the drivers but on power up, the micro runs a bootloader for <750ms so for me ...
2
votes
Using INT2/3 on Arduino Micro (Atmega32u4)
You problem isn't with your pins or code, but with debouncing the signals. I've changed the "func()" method to read:
void func()
{
static uint32_t lastChange = 0; // Note millis() don't change ...
2
votes
Pro Micro recognised as Micro (win10, IDE 1.8.1)
Treat it as what it is.
What windows sees it as is just what USB reports it as. It's just a name. It has no bearing on what it is or how you program it. Select the actual board that you have in the ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
arduino-micro × 191usb × 23
arduino-uno × 18
atmega32u4 × 15
serial × 14
power × 10
arduino-leonardo × 10
arduino-ide × 9
bluetooth × 9
mpu6050 × 8
arduino-pro-micro × 8
sensors × 7
timers × 7
analogread × 7
keyboard × 7
arduino-nano × 6
pins × 6
softwareserial × 6
c++ × 5
i2c × 5
communication × 5
bootloader × 5
programming × 4
interrupt × 4
library × 4