123
-=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- (c) WidthPadding Industries 1987 0|569|0 -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=- -=+=-
Socoder -> Misc Languages -> Getting started with Raspberry PI Pico - Jiggly Noise

Page : 1 2 Next
Prev
Thu, 06 Oct 2022, 03:06
cyangames

Getting started with Raspverry PI Pico - help?


So, I've ordered the components to put together a project that essentially boils down to an audible accelerometer ( you shake it, it makes more noise, until you stop shaking it)

I have:

a raspberry pi pico board
a couple of piezo speakers
a 3 Axis GY-521 MPU-6050 Gyroscope Accelerometer Module

and little to no knowledge when it comes to circuitry.


Any ideas on the best places to start with this sorta stuff would be great.

( I guess this unwittingly would cater for the wibbly criteria for this month, ha! )

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Thu, 06 Oct 2022, 03:36
Jayenkai
If those Electronic Crates taught me anything, it's that to put anything together you're likely going to need half-a-dozen resistors.
And if you're aiming to do it without a giant breadboard dangling off the side, and all the bits coming loose when you do Wibble it about, you're probably also going to need a soldering iron.

... other than that, I learned nothing!!
Spinal..?

-=-=-
''Load, Next List!''
Fri, 07 Oct 2022, 16:20
cyangames
Well, I at least have a flashing LED so far

Looking forward to when the piezo speaker arrives to get some sorta of noise in there.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Fri, 07 Oct 2022, 20:19
steve_ancell
Remember to observe that the I/O is 3.3 Volt based, unlike Arduino which is 5 Volt. Applying 5 Volt to a 3.3 Volt system will blow your Raspberry.
Sat, 08 Oct 2022, 00:35
cyangames
Thanks Steve, will keep that in mind when checking out batteries, etc

Found this lil shim which is out of stock currently but seems to be the thing I'd need in the future

https://shop.pimoroni.com/products/pico-lipo-shim?variant=32369543086163

Also, a handy guide to hooking up a nicer speaker, with MP3 support!

https://learn.adafruit.com/mp3-playback-rp2040

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Sat, 08 Oct 2022, 03:20
spinal
There are Arduino libraries for the pico, can't remember how to set it up though, Google can halp there. Unfortunatly all I did with mine was NOT finish that virtual keyboard idea

-=-=-
Check out my excellent homepage!
Mon, 10 Oct 2022, 03:48
cyangames
Am thinking about just soldering to the board to conserve space, is this a good or bad idea? Or should I just used some short wires in the meanwhile?

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 04:09
Jayenkai
A solder to a short "bridge" would end up having twice the failpoints.
If you're wibbling it a lot, those would likely break quicker.

On the plus side, it's easier to fix things with bridges. Instead of unsoldering from the board all the time, you could just cut the bridge down a little bit.

...
My answer isn't helpful!

-=-=-
''Load, Next List!''
Mon, 10 Oct 2022, 05:59
cyangames
Small wires is probably the easier solution for the moment then, also, found a whole bunch of soldering nibs / heads over the weekend so, that'll be fun!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 11:43
cyangames


So, pieces arrived and the lil piezo speaker is somehow the largest thing here?!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 12:51
Jayenkai
Good luck!
Mon, 10 Oct 2022, 12:56
cyangames
Done some soldering, and it worked!, Piezo speakers are not the loudest in the world unsurprisngly!


View on YouTube

I need to strip some more wires to get the accelerometer attached now.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 14:03
cyangames


Accelerometer attached, green LED means we're okay, hopefully!

Now to figure out how to read data from it!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 14:59
cyangames
Looks like power was there but oddly no data coming from it, gonna desolder the scl and sda lines and retry tomorrow night.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 10 Oct 2022, 17:10
cyangames
Woo, got it working eventually! it now makes a noise (well, a tone) if you shake it a certain amount.

Next, to add proper sound to it, not just tones.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Tue, 11 Oct 2022, 04:01
cyangames
Updated parts list ( just a reference foir myself more than anything)

https://shop.pimoroni.com/products/tiny-2040?variant=39560012234835 -TINY PI .. .maybe
https://shop.pimoroni.com/products/pico-lipo-shim?variant=32369543086163 - BATTERY SHIM
https://shop.pimoroni.com/products/lipo-battery-pack?variant=20429082055 - BATTERY
https://shop.pimoroni.com/products/mini-oval-speaker-8-ohm-1-watt?variant=31150555267155 - SPEAKER
https://shop.pimoroni.com/products/adafruit-i2s-3w-class-d-amplifier-breakout-max98357a?variant=21696217799 - AMP

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Tue, 11 Oct 2022, 05:31
cyangames
I'm a derp, I know, but...

https://pico.pinout.xyz/

The VBUS pin would be 5V out wouldn't it?


|edit| LOOKS LIKE IT IS, YAY! https://raspberrypi.stackexchange.com/questions/132318/raspberry-pi-pico-5v-output-using-vbus |edit|

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Thu, 13 Oct 2022, 09:35
cyangames
Had an email back from the fine folks at pimoroni and I might not need an amp for this, which is handy. Gonna write up a wav playing module tonight hopefully. 30seconds of 8bit, 8000Hz raw audio weighs in at 1.28MB leaving not much space for progam logic as there's only 2MB of Flash Memory on the Pico, we shall see I guess

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Thu, 13 Oct 2022, 09:36
Jayenkai
If your NES-dev taught you anything, it's memory optimisation!!

-=-=-
''Load, Next List!''
Thu, 13 Oct 2022, 09:53
cyangames
Hells yeah it did, that and Gameboy dev also, Infintron had some crazy optimisations to fit it within 32kb. I think flap happy still had ~6kb spare, although there's going to be a couple more changes to that game soon, hidden tricks with the select button on the main menu, i've said too much

Going back to the pico I think this time around it'll be more balancing the non audio playing part of the main loop to keep clock cycles consistant with the sound effects, although the processor is over 150MHz so I guess it's not really a worry. We shall see.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Thu, 13 Oct 2022, 14:15
cyangames
The IDE I've been using can't handle arrays longer than 100 entries... so, switching to circuit python instead. eeshhh

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Thu, 13 Oct 2022, 16:15
cyangames
Oh wow, circuit python is So much nicer to use, turns out I do need to buy that lil AMP to get things working, along with a nice little laptop quality speaker. Now to wait for delivery sometime next week.

Circuit python seems to support mp3 encoding / decoding from within itself and the DAC should go up to 128kbps @ 44.1kHz so , even using nicer qulaity audio I'm going to have much more space for other sound effects to be stored.

I might try to scare the kids / workmates by bunging the final thing inside a plush toy then having it scream and shriek when I shake it about the place, hahaha, there's so many things wrong with me but it'd be appropriate for Halloween at least

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Sat, 15 Oct 2022, 05:19
cyangames
Bits and bobs have arrived today, might have a play with them tonight if time is on my side!

Have been looking into all sorts of battery solutions in the meanwhile.

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Mon, 17 Oct 2022, 03:36
cyangames
Probably tonight now, ha! I guess this lil project still fits under the category of wibbly, might put an updated video up tonight, ideally with a louder speaker attached!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Sun, 30 Oct 2022, 13:06
cyangames
Finally got around to wiring up the speaker and amp and, it's still fairly quiet sadly, 1w, 8ohms isn't very much still, wandering about taking a speaker out of an old mobile phone perhaps to get something louder.

Still though, it plays mp3s!

-=-=-
Web / Game Dev, occasionally finishes off coding games also!
Sun, 30 Oct 2022, 14:00
Jayenkai
hurray!
Good idea pinching a speaker from a phone, but you'll have to double check specs online to be sure things aren't going to explode

-=-=-
''Load, Next List!''
Page : 1 2 Next
Prev