-
Notifications
You must be signed in to change notification settings - Fork 12
mcp 3462 with Arduino Zero definition-question not issue! #16
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
Comments
do you use a pullup resistor at pin /IRQ ? |
beside that I am relatively sure your problem is because of my code... sorry. which exact commit are you on? does your code still freeze if you remove if so: there is a while loop inside which is not working, I have seen other people fail here
please read #5 (comment) there this issue was already discussed. |
Hi and thanks for responding! I've changed out my resistor for a 100k, so thank you for that catch. When I comment out |
as just proven the definition of mcp() is fine, problem is the readAnalog() function. |
no worries! Thank you for your time! |
@beyondblood did you ever get this chip to work? I having issues as well.. |
Not really an issue, more of a question so apologies...
I'm attempting to read from channel 0 in mux mode but having issues even entering the setup and loop sections. I'm assuming it's something to do with my mcp definition since I've tested the println function and it seems to work. I'm using an Arduino Zero which is SAMD21. I added a lot of print statements to try and figure out where the program is/isn't making it to. If I go by these statements, the setup and loop aren't being read. Assuming that I've done something really dumb since I'm quite new to this.
MCP3462 mcp(10); //the problem?
void setup() {
Serial.begin(115200);
while (!Serial)
;
Serial.println(FILE);
if (!mcp.begin()) {
Serial.println("failed to initialize MCP");
while (1)
;
}
}
// the loop routine runs over and over again forever:
void loop() {
// read the input on default analog channel:
int32_t adcdata = mcp.analogRead(MCP_CH0);
// Convert the analog reading
double voltage = adcdata * mcp.getReference() / mcp.getMaxValue();
Serial.println("converted voltage");
// print out the value you read:
Serial.println("voltage: ");
Serial.print(voltage, 10);
Serial.println("printed voltage");
// pause program for one second
delay(1000);
}
The text was updated successfully, but these errors were encountered: