Counter function

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
User avatar
adafruit_support_mike
 
Posts: 67446
Joined: Thu Feb 11, 2010 2:51 pm

Re: Counter function

Post by adafruit_support_mike »

It looks like you don't have this line:

Code: Select all

#include "Adafruit_MCP23017.h"
The compiler needs that to make the rest of the code work as it should. It looks like you also forgot to call 'PR.begin()', so that would be another error waiting for you down the line.

The example sketches from the Adafruit_MCP23017 library show you how to handle the basic object creation and initialization:

https://github.com/adafruit/Adafruit-MC ... button.pde

WRT the physical connections, I just looked for a tutorial and only found one for the Raspberry Pi. Post a photo of how you have things hooked up and we'll make sure that part is correct.

zeramant86
 
Posts: 26
Joined: Tue Mar 25, 2014 4:34 pm

Re: Counter function

Post by zeramant86 »

Basically, I have the setup seen here wire wise, but without the resistors. I don't currently have the resistors.
http://tronixstuff.com/2011/08/26/tutor ... -io-ports/

Also, I messed around with the photoresistors some, and I could get them to dim, but not fully cutoff. This is the photoresistor I'm using, would the position of the resistor matter (before/after PR?).
http://www.goldmine-elec-products.com/p ... ber=G15175

So to get it to operate as a on/off when the laser is removed, would be a 1kOhm resistor, right?

I'll try to compile with the added revisions. Thanks for the help. I'm on a time crunch now for this project, but the help is greatly appreciated.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”