"Guru Meditation Error: Core 1 panic'ed (IntegerDivideByZero). Exception was unhandled."

Hello Guys! I have this code: /*! * @file basicRead.ino * @brief Output readings of red light and IR * - Pastebin.com

But after i add this:

1. AC = redMax - redMin;

2. DC = redMax - AC;

3. Perfusionsindex = (DC / AC) * 100;

I get this error:

" R=1061 Max=1066
 Min=0
 AC=1066
 DC=0
 Perfusionsindex=0
Guru Meditation Error: Core  1 panic'ed (IntegerDivideByZero). Exception was unhandled.

Core  1 register dump:
PC      : 0x400d1525  PS      : 0x00060a30  A0      : 0x800d3458  A1      : 0x3ffb2800
A2      : 0x0000042a  A3      : 0x3ffc23c8  A4      : 0x3ffc23d8  A5      : 0x3ffc23cc
A6      : 0x3ffc23d0  A7      : 0x3ffc23dc  A8      : 0x00000000  A9      : 0x3ffb27e0
A10     : 0x00000003  A11     : 0x00000001  A12     : 0x0000000a  A13     : 0x00000002
A14     : 0x00000003  A15     : 0x00000001  SAR     : 0x0000000a  EXCCAUSE: 0x00000006
EXCVADDR: 0x00000000  LBEG    : 0x400866c1  LEND    : 0x400866d1  LCOUNT  : 0xfffffffb

Any ideas?

it says IntegerDivideByZero. so AC is zero

Post code to this forum! Never use temporary storage sites as pastebin.com because if someone finds this thread in half a year that content is gone and (s)he won't understand what the problem was..

Although the printed values might get the impression that there isn't a division by zero, that impression is wrong. That's because the code prints out the values before it mangles them. After printing out the values AC is calculated to be 0 so you get that error (a division by zero isn't allowed mathematically). Most probably your formula is wrong.

1 Like

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.