Adafruit Industries, Essential service and business: NYC – Executive Order 202.6 - Read more. Accepting essential orders - here's how.
0

sound effect player connecting to arduino mega
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Sun Jan 26, 2020 7:46 am

The beam from the emitter has a bit of spread to it. But the detector side only sees the rays that hit it. So in effect it is a narrow beam. Ambient IR can cause false triggering. But that is typically more of an issue when used outdoors.

From what you describe, I suspect that the beam-beak is too brief to capture in your loop. A better approach is to use interrupts. The Mega has 6 external interrupt pins:
https://www.arduino.cc/reference/en/lan ... interrupt/

There are also 'pin change interrupts' which are a little more work, but are supported on many more pins: https://github.com/NicoHood/PinChangeInterrupt

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Sun Jan 26, 2020 8:32 am

I have 8 sensors/ball slots to monitor so the mega external pins are only 6 so I would assume this rules this option out.

I purchased 6 adafruit mosfets from core electronics in Aust as you did not have stock. I have noticed that there are two types supplied.
IRLB8721 P527D YIZ7 AND IRLB8721 P444D YE2G Are these both N channel Mosfets?

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Sun Jan 26, 2020 9:09 am

So Pin-change interrupts would be your best bet for the sensors.

The IRLB8721 are all N-channel MOSFETs. The other numbers are date codes and lot-numbers. The 'P' means that it is lead-free.

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Sun Jan 26, 2020 10:06 pm

Am I able to use the current sensor pins on the mega I have set or do I have to use valid mega pins ( 10, 11, 13, 50, 51, 52, 53, A8 (62), A9 (63) A13(67) A14 (68) A15 (69) as indicated in the article?? I thought using the Pin change interrupts any pin could be an interrupt.

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Mon Jan 27, 2020 6:55 am

On an UNO, any pin can be used for pin-change interrupts. On the Mega, you are limited to those listed in the article.

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Tue Jan 28, 2020 8:20 am

Hi Bill. Back to work tomorrow:( I painted the balls black and it solved the problem of the break beams not registering :( (At least at the moment). As long as the paint sticks to the plastic it should work ok. This of course was the simplest fix and saves me redoing all the codes :). So the 1st prototype is nearly ready for painting only 5 more to go:( Wish I had a laser wood cutter. Video to follow of my Frankenheadstein Game!

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Tue Jan 28, 2020 9:23 am

The black paint should keep the IR from leaking through those translucent balls. I noticed that the ones in your photo from a few posts back are red & orange. If you have any blue or green ones, they would probably be more opaque to the infrared wavelengths.

In any case, looking forward to seeing the finished game!

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Sat Feb 01, 2020 5:16 am

Still on the hunt for black balls. Here is the finished prototype. The only electronics not used from adafruit is the mega.
https://youtu.be/mqX16Zg6FZ8
5 mre to build:(

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Sat Feb 01, 2020 6:50 am

Nice work as always. Another great looking game :)

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Thu Mar 26, 2020 7:00 am

Hi Bill,
I hope you are well and keeping 1.5 metres away when drafting on the bike :). Have nearly finished the 5 other head turning games. Have changed the design slightly. School holidays here but have to stay at home because of the virus but the good side is that I can work on the games.

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Thu Mar 26, 2020 7:22 am

Maybe you should design a virus themed game ;)

With everything shut down here, there are not many cars on the roads, so at least the riding has been good.

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Thu Mar 26, 2020 7:56 am

I do remember a board game called virus. Keep safe.

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by roadshark on Tue Mar 31, 2020 7:46 am

Hi Bill,
In lock down here sort of. Can leave the house to get food or exercise but limited to groups of 2:) SO i have one riding pal.
To use the ItsyBitsy as a slave, you will need pullup resistors on SDA and SCL. 10K should work.

I am using the 1.2" display as well as the itsy. Is there a schematic which shows me how to wire this or do I just connect the resistor to the positive power?

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Re: sound effect player connecting to arduino mega

by adafruit_support_bill on Tue Mar 31, 2020 8:07 am

Rebuilt the tandem drivetrain and got that back on the road last week, so my 'group of 2' is all set.

In most cases, you really only need one set of pullups on the i2c bus. If you have the display on the same bus, you should be fine without additional pullups.

adafruit_support_bill
 
Posts: 76695
Joined: Sat Feb 07, 2009 10:11 am

Re: sound effect player connecting to arduino mega

by roadshark on Thu Apr 02, 2020 8:34 am

Are you the stoker or captain. I took my tandem on a trip to king Island (Between Tasmania and mainland Australia). Stayed at a cabin and had to ride 30 km to the store and back every day. My stoker was a bit of a slacker:)

roadshark
 
Posts: 585
Joined: Sun Nov 29, 2015 5:53 am

Please be positive and constructive with your questions and comments.