Circuit Dude [2.1] - Awesome Puzzle Game With 50 Levels!


Oh no’s :scream: One of my favorite games been crippled :sob:. I looked into why the problem is more severe and figured out it’s because analogWrite configures the LED pins as digital when maximum and minimum values are set. The new version sets the LED pins always to pwm.

I’ve written an optimized analogWrite equivalent that doesn’t break circuitdude.


I’ve added the changes to my fork of the Arduboy2 library and to the homemade board package

(Scott) #163

I felt a little guilty about “crippling” Circuit Dude with the new version 5 Arduboy2 library, so I’ve modified it to use the BeepPin2 class for sound. The rising temperature sound is as smooth as the ArduboyPlaytune version, and the red RGB LED now increases in brightness as intended.

Just compiling the original code with Aruduboy2 library version 5.0.0 instead of 4.1.0 saves 634 bytes of program memory (and 7 bytes of RAM). This is mainly due to the optimised setRGBled() function in the new library release.

Changing sound from using the ArduboyPlaytune library to the BeepPin2 class saves another 2102 bytes of code and 32 bytes of RAM, for 2736 bytes of code and 39 bytes of RAM total. There is now enough program space to add 30 more levels, if @crait desired.

Unfortunately, @crait doesn’t want people publishing modified versions of Circuit Dude, so I can’t make my changes publicly available. I will send @crait a PM with a link to it, so he can apply and publish the changes himself if he wishes.

P.S. making other changes to optimise, as I’ve pointed out in previous posts in this topic, could save a bit more code.

Arduboy2 - The now recommended alternative to the Arduboy Library

If you do @crait, I hope you add button redundancy too so you can choose to use the A or B button.

(Scott) split this topic #165

A post was split to a new topic: What library is best for my game sounds?


I am very excited to delve into this game. Quick question: How do I fix the text so as not to appear elongated? Thank you!


Did you compile from source? @flimote had a similar issue lately.

(Pharap) #168

It most likely is the same issue.

It only happens with the 1.8.6 and 1.8.7 versions of the IDE.
@Mr.Blinky found a fix for that, which will be in the next version of the Arduboy2 library.

But the next release might be a while off still, we could do with a few testers/early adopters to make sure the fixes didn’t break anything else.

As the song goes:

99 little bugs in the code, 99 little bugs,
you squash one down, patch it around,
109 little bugs in the code.

@MEMalguy, which version of the Arduino IDE are you using, and which version of the Arduboy2 library?


I am currently using the most updated IDE and Arduboy2. The handheld itself is a couple of years old, though.

(Pharap) #170

Then it’s almost certainly the same bug.

Your options are to roll back to the 1.8.5 IDE (which you can get here),
or take the version of the Arduboy2 library from the master branch (specifically this link) and use that to compile with.


You could also upload a precompiled hex from @Eried’s or @crait’s repos.

(Scott) #172

Even if you roll back to 1.8.5 or use the Arduboy2 pre-release and it fixes what you’re seeing, you’re still going to encounter the problem I described in this post:

@crait has never applied the fix that I offered or addressed the problem in some other way

Circuit Dude [2.1] - Awesome Puzzle Game With 50 Levels!

(Simon) #173

Best approach might be to simply download the HEX rather than compile it yourself.

(Pedro) #174

Just finished the game! And I love the secret ending (I didn’t expect that) :slight_smile: Great level design, I enjoyed every minute of the game! A must have for the Arduboy! Thanks @crait (even I hated you so much on some levels :stuck_out_tongue:) Now time to play it on Steam!

(The Querulous One) #175

I also want to spread some love for Circuit Dude - my favourite Arduboy game so far! Excuse the shoddy photo.