Interrupts in Arduino Due
SuperGops last edited by
I require my Arduino Due to be able to plot a square wave with a predetermined duty cycle and time period, without the use of delay() or millis() or any such function that keeps the processor idle unnecessarily. Hence, I've decided to go for interrupts and found a lot of resources on implementing it on the Uno, but none for the Due.
Can someone shed light on how I can set up an interrupt ( I guess two will be required here) from the inbuilt timers in the Due?
salmanfaris last edited by
Hi @SuperGops , All the digital pins of Arduino Due are capable of interrupts, and since you are using the Arduino framework everything is the same as Arduino Uno.
SuperGops last edited by
@salmanfaris Thanks! I'll definitely have a look at these!
rafitc99 last edited by
@SuperGops You can use a Timer interrupts or run interrupts via watchdog timer.
kowshik1729 last edited by
@SuperGops When you want to create a PWM signal, why don't you just use
to just create your PWM? Is there any specific reason you are going for interrupts?
I haven't found a good sensor module for this at al
another option is that you can build capacitive sensor your own with resistors.
"Energy is liberated matter, matter is energy maintained" ~ Bill Bryson
Have you ever wondered what the future of energy would be like? Especially since machine learning has opened up such a wide range of innovations and opportunities?
Care to take a look at the answers?
The RSET IEEE Power and Energy Society SBC proudly presents to you an informative webinar on "Machine Learning in Power Systems" hosted by Dr. Qiuhua Huang.
Dr. Qiuhua Huang is currently a Senior Power System Research Engineer with the Electricity Infrastructure Group, Pacific Northwest National Laboratory, USA. He has been a Principal Investigator, Project Manager, Task Lead and Key Technical Contributor in 10+ DOE-funded projects. Besides these, he is also the recipient of the 2019 IEEE PES Prize Paper Award, 2018 R&D 100 Award and several other achievements in his field of expertise.
Join us as we delve into the enigma that is Machine Learning.
Registration open to all.
Date: 7th June 2020
Time: 11:00 a.m
@salmanfaris best if you could point me to an example that works as described: getting different values depending on hoe close the finger is without really touching. nothing i tried did work yet
@salmanfaris I haven't found a good sensor module for this at all. I used a thing which was calles touch sensor and it returns only 1/0. Tried to use touchRead() but it is not sensitive apparently, only 40 and 1 more or less.
#define touch_pin_numer 33
const int VALUE_THRESHOLD = 30;
TOUCH_SENSOR_VALUE = touchRead(touch_pin_numer);
if(TOUCH_SENSOR_VALUE < VALUE_THRESHOLD)
Serial.println ("Touch ON");
Serial.println ("Touch OFF");
should show something between 40 (current max) and 1 (current min) the closer the finger gets but it shows 40/41/39 and 1 - nothing inbetween. got this code from the web