I'm doing some synth/sound stuff and have a couple littleBits Arduino bits (32U4). Hoping to try some of the sketches meant for the Grains AE module which uses a 328. Since these processors are closely related, I'm guessing the main difference between the two are the in/out pin assignments, which would need to be changed in the sketch. Any other considerations to look out for or perhaps a quick guide in adapting sketches between Arduino models?
That's not an option for me. I'm integrating the Arduino bit into a larger littleBits synth rig. Having to mess with breadboards, soldering or adding a different form factor defeats the convenience of going with littleBits platform. I'm trying to see how far I can take the littleBits stuff.
At a glance the littleBits processor board uses normal IDE pin naming conventions.
I haven't looked at any sketch you may have linked to, but Imma guess it would have a good just of just working as long as you have the pins assigned to ones that the littleBits board makes available.
When I have a bigger window I will look at anything you've linked. Seems all straight ahead what Imdid see.
Thanks for chiming in. Yes, the littleBits Arduino bit is essentially a regular Leonardo. All the normal connectors seem to be there, just some use the littleBits snap connectors, while others are bare on the board.
I think the trick is that the Grains module seems to use a different pin names and it also looks like there are 3 analog CV inputs vs the 2 analog/1 digital on the littleBits connectors. I've never coded Arduino, so I'm not sure how to properly switch those assignments in the sketch. If I just try to upload a Grains sketch to the littleBits I get a "Compilation error: 'TCCR2A' was not declared in this scope."
That register is one of the control registers for Timer2 on the 328P. It sounds like the 32u4 doesn’t have a Timer2 so you will have to move that function to a different timer. That will probably require using different output pins (the PWM outputs are driven by hardware timers)
Ok that makes sense. I need to figure out the the 32U4's control registers and corresponding output pins that match the 328's functionality, then change those values in the sketch. Worth a try. Thanks.
Hi Davis, did you make any progress? I own a littlebits arduino synth myself and i think its a great idea, but new to arduino also.
Have a nice day, Jort
Hi Davis, thanks for answering. Unfortunately i am not on facebook, but yes i like littlebits synt a lot. please report here if you if you make progres. Will check your recommendations.