Linked Questions

2 votes
2 answers

Arduino Mega 2560 interrupt pins and port mapping with rotary encoder

I am trying to use port manipulation in interrupts to read a rotary encoder. I found code for a Uno, so the port call for pins 2 and 3 are different. I think on the Mega they are PORTH3 and PORTH4 ...
kumquat's user avatar
  • 61
2 votes
2 answers

Arduino read PWM duty cycle value with input (analog / digital)

I am working on comparing autopilots like Ardupilot, CC3D, KK2.1.5. The comparision is about system reactions/behaviors that it gives during flight. For this purpose, I need to read the PWM duty cycle ...
acs's user avatar
  • 235
1 vote
1 answer

Arduino documentation on PCIFR and PINC

I was reading this thread: Read RC receiver channels using Interrupt instead of PulseIn and I have been trying to understand the code provided within. While I was able to udnerstand most of it, I ...
Drazha's user avatar
  • 13
1 vote
2 answers

How to read RC receiver channels without using pulsein() command with arduino

I am building a quad-copter, the problem is of stability and for better stability lesser sampling time is required. For lesser sampling time I need to have faster loop() function. But the Pulsein() ...
Bilal Ayub's user avatar
1 vote
1 answer

Can external interrupts be OR'd together on the '328 (Uno)?

I'm thinking about how to handle a rotary encoder. I'm planning on using interrupts and would like to use both the 'A' and 'B' phase transitions to generate interrupts. I'm wondering if there is any ...
dlu's user avatar
  • 1,651
1 vote
1 answer

Rotary Encoder problem with LCD Display

Program reads rotary encoder correctly without bouncing in this code: int val = 0; byte clkPin = 3; byte dtPin = 2; bool lastClk; bool lastDt; void setup() { pinMode(clkPin,INPUT); pinMode(dtPin,...
Çay Öncesi's user avatar
3 votes
2 answers

How to read RPS for fast rotation with status change method in Arduino?

I'm trying to calculate the coming RPS from rotary encoder. I am trying to get it by checking the status with digitalRead. However, I can not get more than 6 RPS. Any solution? I will be obliged for ...
zalt's user avatar
  • 93
0 votes
1 answer

Is PulseIn fast enough for Quadcopter?

I've been trying to use interrupts to control a quadrotor with a tx/rx to no success. I'm using an arduino mega as my control board. I have successfully read a singe channel using attach interrupt and ...
Ozymandias's user avatar
1 vote
1 answer

Why doesn't this work on a Mega2560 although it works on an Arduino Uno

So, This is your code slightly altered. I am using it to read the readings of the roll and pitch of a quadcopter. I have tried using this code for a mega 2560 but it does not work in ports A0 and A1. ...
Rohan Paleaj's user avatar
2 votes
3 answers

How can I alter my program to read PWM signals from Arduino Mega?

I am new to programming and Arduinos but I've decided to give a go for a project. I'm after a code that will read PWM signals from a RC receiver (Specifically aileron and throttle) and output this as ...
sacred230's user avatar
1 vote
1 answer

other interrupts in rc channel reader

I have the sketch from James Waldby (Read RC receiver channels using Interrupt instead of PulseIn) working beautifully. I want to use a switch on my TX to start and stop a sequence of lights (...
Doug Hemingway's user avatar