-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AS7265X_Dragonfly.ino build fails #2
Comments
Delete reference to TWI pins in Wire.begin() then.
Each register for the sensor data is unique. You can read it all at once as
I do or read one channel at a time. The channels are not entered multiple
times only once each.
…On Tue, Oct 9, 2018 at 2:04 PM Alec ***@***.***> wrote:
I'm having a couple issues with your demo sketch, listed below.
-
Line 38 is: Wire.begin(/*TWI_PINS_20_21*/); // set master mode, which
fails compile time since TWI_PINS_20_21 is not defined. Furthermore,
the arduino documentation
<https://www.arduino.cc/en/Reference/WireBegin> specifies that adding
an argument to Wire.begin() will join i2c as slave with the 7 bit address
specified, which seems counterintuitive to what this code is doing. I
managed to get it working using just 'Wire.begin(), which joins i2c as
master.
-
Line 79 is: (delay(100); where it should be delay(100);
-
In your header file, you write:
`#define AS72651_CAL_CHAN0_0 0x14
#define AS72651_CAL_CHAN0_1 0x15
#define AS72651_CAL_CHAN0_2 0x16
#define AS72651_CAL_CHAN0_3 0x17
#define AS72651_CAL_CHAN1_0 0x18
#define AS72651_CAL_CHAN1_1 0x19
#define AS72651_CAL_CHAN1_2 0x1A
#define AS72651_CAL_CHAN1_3 0x1B
#define AS72651_CAL_CHAN2_0 0x1C
#define AS72651_CAL_CHAN2_1 0x1D
#define AS72651_CAL_CHAN2_2 0x1E
#define AS72651_CAL_CHAN2_3 0x1F
#define AS72651_CAL_CHAN3_0 0x20
#define AS72651_CAL_CHAN3_1 0x21
#define AS72651_CAL_CHAN3_2 0x22
#define AS72651_CAL_CHAN3_3 0x23
#define AS72651_CAL_CHAN4_0 0x24
#define AS72651_CAL_CHAN4_1 0x25
#define AS72651_CAL_CHAN4_2 0x26
#define AS72651_CAL_CHAN4_3 0x27
#define AS72651_CAL_CHAN4_0 0x28
#define AS72651_CAL_CHAN4_1 0x29
#define AS72651_CAL_CHAN4_2 0x2A
#define AS72651_CAL_CHAN4_3 0x2B
`
What is the purpose of redefining all of these values multiple times?
Won't the final values be the last 4 lines?
- Finally, for some reason the void loop() function is not entered. I
believe it is because the final AS7265X.getStatus() does not return.
For example, this code
Serial.print("attaching interrupt to myIntHandler()...");
attachInterrupt(intPin, myIntHandler, FALLING); Serial.println("done");
Serial.println("status:" + AS7265X.getStatus());
returns attaching interrupt to myIntHandler()...done and nothing else.
Thanks for the help
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY1qt42yE19fms5KqG_mTqtn9zeGmlzks5ujQ9UgaJpZM4XUIcw>
.
|
I took a second look at the register definitions, and I see how each register is unique except for your last 8 definitions for
Since these values are being redefined, what is the purpose of your first 4 definitions for CHAN4? Furthermore, I'm not quite sure where these definitions are used (and therefore their significance), I couldn't find any usages in anywhere in your repo. Forgive me if I'm missing something, I'm quite inexperienced with C++. |
Yup, last four entries should be channel 5. Good news I am not using these
in the burst read data function.
…On Tue, Oct 9, 2018 at 2:23 PM Alec ***@***.***> wrote:
I took a second look at the register definitions, and I see how each
register is unique except for your last 8 definitions for
AS72651_CAL_CHAN4. For example, when I compile, I get these warnings:
sketch/AS7265X.h:57:0: warning: "AS72651_CAL_CHAN4_0" redefined
#define AS72651_CAL_CHAN4_0 0x28
^
sketch/AS7265X.h:52:0: note: this is the location of the previous definition
#define AS72651_CAL_CHAN4_0 0x24
^
sketch/AS7265X.h:58:0: warning: "AS72651_CAL_CHAN4_1" redefined
#define AS72651_CAL_CHAN4_1 0x29
^
sketch/AS7265X.h:53:0: note: this is the location of the previous definition
#define AS72651_CAL_CHAN4_1 0x25
^
sketch/AS7265X.h:59:0: warning: "AS72651_CAL_CHAN4_2" redefined
#define AS72651_CAL_CHAN4_2 0x2A
^
sketch/AS7265X.h:54:0: note: this is the location of the previous definition
#define AS72651_CAL_CHAN4_2 0x26
^
sketch/AS7265X.h:60:0: warning: "AS72651_CAL_CHAN4_3" redefined
#define AS72651_CAL_CHAN4_3 0x2B
^
sketch/AS7265X.h:55:0: note: this is the location of the previous definition
#define AS72651_CAL_CHAN4_3 0x27
^
Since these values are being redefined, what is the purpose of your first
4 definitions for CHAN4?
Furthermore, I'm not quite sure where these definitions are used (and
therefore their significance), I couldn't find any usages in anywhere in
your repo. Forgive me if I'm missing something, I'm quite inexperienced
with C++.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#2 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGY1qnq_ngiNgonvRgRAx81CfgqWUca2ks5ujRPMgaJpZM4XUIcw>
.
|
Thanks, got it working. Turns out my other issues were because I forgot to wire up the INT pin... whoops. Also worth noting (if anyone else has issues getting the code to work) I had to change the intPin value from pin 8 to 3 as the arduino mega (and most other arduinos) don't support adding an interrupt on pin 8. Thanks for your help! |
I'm having a couple issues with your demo sketch, listed below.
Line 38 is:
Wire.begin(/*TWI_PINS_20_21*/); // set master mode
, which fails compile time sinceTWI_PINS_20_21
is not defined. Furthermore, the arduino documentation specifies that adding an argument to Wire.begin() will join i2c as slave with the 7 bit address specified, which seems counterintuitive to what this code is doing. I managed to get it working using just 'Wire.begin(), which joins i2c as master.Line 79 is:
(delay(100);
where it should bedelay(100);
In your header file, you write:
`#define AS72651_CAL_CHAN0_0 0x14
#define AS72651_CAL_CHAN0_1 0x15
#define AS72651_CAL_CHAN0_2 0x16
#define AS72651_CAL_CHAN0_3 0x17
#define AS72651_CAL_CHAN1_0 0x18
#define AS72651_CAL_CHAN1_1 0x19
#define AS72651_CAL_CHAN1_2 0x1A
#define AS72651_CAL_CHAN1_3 0x1B
#define AS72651_CAL_CHAN2_0 0x1C
#define AS72651_CAL_CHAN2_1 0x1D
#define AS72651_CAL_CHAN2_2 0x1E
#define AS72651_CAL_CHAN2_3 0x1F
#define AS72651_CAL_CHAN3_0 0x20
#define AS72651_CAL_CHAN3_1 0x21
#define AS72651_CAL_CHAN3_2 0x22
#define AS72651_CAL_CHAN3_3 0x23
#define AS72651_CAL_CHAN4_0 0x24
#define AS72651_CAL_CHAN4_1 0x25
#define AS72651_CAL_CHAN4_2 0x26
#define AS72651_CAL_CHAN4_3 0x27
#define AS72651_CAL_CHAN4_0 0x28
#define AS72651_CAL_CHAN4_1 0x29
#define AS72651_CAL_CHAN4_2 0x2A
#define AS72651_CAL_CHAN4_3 0x2B
`
What is the purpose of redefining all of these values multiple times? Won't the final values be the last 4 lines?
void loop()
function is not entered. I believe it is because the finalAS7265X.getStatus()
does not return. For example, this codeSerial.print("attaching interrupt to myIntHandler()..."); attachInterrupt(intPin, myIntHandler, FALLING); Serial.println("done"); Serial.println("status:" + AS7265X.getStatus());
returns
attaching interrupt to myIntHandler()...done
and nothing else.Thanks for the help
The text was updated successfully, but these errors were encountered: