Saturday, 26 October 2024

Mega City Block Upgrade - Arduino Nano MAX7219 Display

A while ago I built a Mega City One Miniature Cary Case for my Judge Dredd miniatures and it was always my intention to have some sort of digital display which I could display random "in game" messages and to send instructions to the players such as ROLL FOR INITIATIVE.

The Components

Arduino Uno / Arduino Nano

I'd been itching to mess around with an Arduino microcontroller for years but never had the courage to just dive in.  However, there are so many people on ebay and Aliexpress selling ridiculously cheap arduino kits that there really is no barrier to entry. 

I plumped for an Arduino Uno Rev 3 Starter Kit which included a breadboard, jumpers and a whole pack of additional resistors and what nots.

The goal here is to make a small form factor self contained device so migrating from the large Uno dev board is essential.  I ordered a random Nano board from Aliexpress before realising that they come in 3 varieties with different board to PC connectors.  the cheap one I had picked came with an old style mini USB B connector and no lead.  Fortunately I had an lead from an old digital camera to use in the meantime, but I quickly ordered a bunch of nanos with USB C connectors for this and other projects I have in mind.  

MAX7219 8x32 Dot Matrix Display

The perfect lo-fi display for this project is a MAX7219 LED 8x32 dot matrix display.  It's small enough to work as a standalone unit and can take its power from the Arduino itself.  I bought one from AliExpress for only a couple of pounds. 

Wiring the MAX7219

I grabbed a bunch of dupont wires (these are the handy dandy push pin connectors which you get in your arduino kit.  I chopped one end off each wire and soldered them to the MAX7219 pins:

  • VCC - Purple - 5v
  • GND - White - GND
  • DIN - Black - Digital Pin 11
  • CS - Blue - Digital Pin 10
  • CLK - Grey - Digital Pin 13

Wiring the Button

The button is wired into:

  • VCC - Red - 5v
  • OUT - Orange - Digital Pin 7
  • GND - Yellow - GND

Entering the The Matrix Code

A bit of googling discovered the perfect code in the form of MAX7219 Message Selector on the Arduino Forums by user groundFungus.  Some tweaking later and I had a bunch of messages which I could toggle through with the addition of a button push on PIN7

// Program to demonstrate the MD_Parola library
// button select canned messages
// MD_MAX72XX library can be found at https://github.com/MajicDesigns/MD_MAX72XX
// by groundFungus AKA c. goulding

#include 
#include 
#include 

const byte  buttonPin = 7;    // the pin that the pushbutton is attached to

// Define the number of devices we have in the chain and the hardware interface
// NOTE: These pin numbers will probably not work with your hardware and may
// need to be adapted
#define HARDWARE_TYPE MD_MAX72XX::FC16_HW
#define MAX_DEVICES 4

// Scrolling parameters
#define SPACE_IN      A5
#define DIRECTION_SET 8 // change the effect
#define INVERT_SET    9 // change the invert

#define CLK_PIN   13
#define DATA_PIN  11
#define CS_PIN    10

MD_Parola P = MD_Parola(HARDWARE_TYPE, CS_PIN, MAX_DEVICES);

// individual messages in strings
const char msg_1[] = "<< WEATHER ALERT>> RAIN IN 10 MIN <> SECTOR 237 RIOT IN PROGRESS <> HOTTIE DAWGS ARE GOOD TO EAT <> BE GOOD CITIZENS LITTERING IS A CRIME>>  ";
const char msg_2[] = "<> ROLL FOR INITIATIVE>>";
const char msg_3[] = "<> GET UGLY GET OTTO SUMPS OIL OF UGLY TODAY!! >>";
const char msg_4[] = "<> HEAVY TRAFFIC ON THE BIG MEG CHOOSE ALTERNATE ROUTES >>";
const char msg_5[] = "<> THIS AREA IS IN LOCKDOWN >>";
const char msg_6[] = "<> CLEAN UP CREWS IN TRANSIT >>";

// an array of pointers to the strings
char *messages[] = {msg_1, msg_2, msg_3, msg_4, msg_5, msg_6};
byte messageNum = sizeof(messages) / sizeof(messages[0]);

int buttonPushCounter = 0;   // counter for the number of button presses
int buttonState = 0;         // current state of the button
int lastButtonState = 0;     // previous state of the button

void setup(void)
{
   Serial.begin(115200);
   Serial.println("\nParola pick a message program\n");
   P.begin();
   pinMode(buttonPin, INPUT_PULLUP);
}

void loop(void)
{
   if (P.displayAnimate())  // time to show next frame?
   {
      P.displayText(messages[buttonPushCounter], PA_CENTER, 50, 3000, PA_SCROLL_LEFT, PA_SCROLL_UP);
   }
   checkButton();
}

void checkButton()
{

   static unsigned long timer = 0;
   unsigned long interval = 25;
   if (millis() - timer >= interval)
   {
      timer = millis();
      buttonState = digitalRead(buttonPin);
      // compare the buttonState to its previous state
      if (buttonState != lastButtonState)
      {
         if (buttonState == LOW)
         {
            // if the current state is LOW then the button
            // went from off to on:
            buttonPushCounter++;  // add one to counter
            // if counter over number of messages, reset the counter to message 0
            if (buttonPushCounter >= messageNum)
            {
               buttonPushCounter = 0;
            }
            //Serial.println(buttonPushCounter);
         }
      }
      lastButtonState = buttonState;
   }
}

Debugging the Code

Unfortunately this particular code only reads the button state at the end of each scroll.  This is where an interrupt is going to be necessary.  The arduino Uno and Nano boards that I have access to are only enabled for interrupts on digital pin 2s and 3 and will necessitate a bit of a rethink in the code 

MAX7219 Case - Thingiverse: Thing 6809712

No one wants to live in a run down cyberpunk world with exposed wires everywhere, so I needed a case for the display with enough depth to house the nano and the button which would switch modes.

I found a simple MAX7219 8x32 case on Thingiverse which I could easily embed magnets into to affix to the top or side of my Mega City Block Storage Case.  Sadly this did not fit my particular MAX7219 board as the pins came out sideways.  

This was easily fixed with a bit of modelling in Sketchup and if you need a case and have side exit pins feel free to download this from Thingiverse using the link above.


Wednesday, 23 October 2024

Jessie's Prints - Episode 48 - Judge Dredd Shuggy Table

This week, I are mostly been printing... A Shuggy Table!!

Shuggy Table - Thingiverse Thing:6804108

Those of you who aren't Judge Dredd fans (there can't be many of you), Shuggy is the futuristic equivalent of billiards (aka pool) which is a popular pastime among the permanently unemployed citizens of Mega City One.

Judge Dredd Shuggy Tables (15mm)
15mm Shuggy Tables (5p coin for size comparison)

Tracing its origins back to the original 21st century ball and stick games, Shuggy is played on a table with 22 holes which are distributed around the surface atop small mounds.  The object of the game is to "pot" balls into the holes to score points.

A complete run down of the rules is provided by Judge Macus L Rowland in the Wally Squad briefing 041204-2103 also found on pages 50-51 of the Judge Dredd Companion.

This particular 22 hole variant of the game was scaled for use in the print-and-play boardgame Shuggy Hall Brawl published in Issue 11 of Warlock Magazine, but it can be easily scaled to suit the larger Judge Dredd Miniatures Game or the many variants of the Judge Dredd RPG

Monday, 21 October 2024

Jessie's Prints - Episode 47 - Nimbus the Goliath

This week, I are mostly been printing... A Nimbus!!

A birthday print for my clubmate Paul.  Sculpted using the heroforge app and then downloaded as an STL

The Heroforge Design

Paul got very creative using the heroforge and came up with this design.  The challenge for me was to try to print and then paint him without turning him another famous grey haired blue skinned chap... Papa Smurf.

Nimbus - Heroforge vs Print

It is also refreshing to have a render to paint from, relieving me from the complex task of designing a colour scheme.

Words of advice from a 3D Printing perspective

Whilst I love that heroforge exists there is a temptation for the wannabe designer to cram every facet of the mini with detail.  From a printer's perspective this is a bad thing.  Everything is possible when you have a $20,000 Selective Laser Sintering machine and you are making minis out of exotic materials like metal or resin powder.

However, when you are commissioning a print for an SLA printer you really need to consider how the model is going to be printed.  Typically this is going to be at 45 degrees on it's back as no one wants to be dealing with support material all over a character's face.

If you have sheathed swords or capes try to keep them close to the body so that they are supported rather than dangling in free space.  Don't go for the Michael Jackson pose where his cape is streaming out behind him in the wind as this will cause your printer do pull their hair out as they try to find somewhere to support the mini.  

Large volumes of cloth streaming out from behind a mini also mean that they have what I like to call a high "snapping moment" this is where there is a lot of resin supported only by one small section.  One false move or indelicate pick up and "click" there goes your cape leaving you to pray to the Glue Gods that it can be stuck back on again.

Merged Accessories and Paper Dolls

The other main gripe I have with Heroforge is that it is easy to model things that blend into one another.  For example, in the case of our boy Nimbus, his cape sprouts out of his pauldron and it is very difficult to tell where one piece starts and another ends.  

A real sculptor would understand that it would sit over top or underneath, a human form of collision detection, and appropriate sculpting would take place to remedy the situation.  Sadly this does not happen with Heroforge and there is no priority system in the software which detects these edge collisions and does something about it.  

It is effectively the digital version of the vintage Paper Doll toy.


Saturday, 19 October 2024

Jessie's Prints - Episode 46 - Looot Insert Boxes

This week, I are mostly been printing... Looot Boxes!!

I am lucky to have a bevvy of machines to do my bidding and enable me to print in both style, Fused Desposition Modelling (FDM) and Stereolithography (SLA).  FDM is the perfect choice for projects like these boardgame organiser boxes.

Looot Insert - Thing 6661983    

This was a commissioned print for my colleague Stephen who is a mad keen boardgamer.  I used some Geetech Silk filament one of the cheapest I could get from Ali Express and I was blown away by the smooth texture.  

Definitely something I will look out for in the future.

Looot Boardgame Insert Boxes

 

Friday, 18 October 2024

OMG Another 5 Starblazer Comics

 Starblazer - Fantasy Fiction in Pictures

Yet more issues from my growing Starblazer collection

Starblazer #209 - The Ring of Gofannon


Starblazer #209 - The Ring of Gofannon - Through a nightmare of sorcery, Goll and his servant, Cutter follow the ancient maps of Gofannon in search of the legendary Ring.  Goll the warrior has to pit his fighting skills against all manner of unworldly creatures to merely survive and discover the truth.

Like every fantasy epic the ring of Gofannon is an archetypal quest to retrieve a magic ring and defeat a great evil descending upon the land.

Goll and Cutter must one by one overcome the trials and obstacles in their journey to find the legendary ring.  However, like every good Starblazer story there lies a twist in the tale, something unexpected which turns the story on its head.

The art for this story is great, simple when it needs to be and detailed when it needs to evoke a dense and rich background.  Very enjoyable and full of great one shot ideas for my own fantasy RPG stories. 

The cover art for this issue is a little bit uninspired.  However, this is what a fantasy story would look like if Sylvester Stallone was cast in the title role.

Starblazer #210 - Dragon Slayer


Starblazer #210 - Dragon Slayer - In a land overrun by evil, only one young boy had the courage and faith to seek out the warrior who could free the country from its sorcerous shadows - Dragon Slayer.., and he was 200 years old.

Another fantasy story, we must have hit the Conan the Barbarian vein in these recent issues.  The evil sorceror Drax has risen up and despite his magic waning he has enslaved the last of the Dragons Gorath to be his ultimate weapon and rule Pira IV unchallenged.

One brave villager and his son go against the wishes of the rest and vow to track down the legendary Dragonslayer who can free them from this cruel fate.  Sadly the villager is trapped by Drax and his son Bix must find the dragonslayer alone.

As ever we expect the Starblazer plot twist at the third act and this story doesn't dissapoint.  The final confrontation between Drax and the young lad Bix is a desperate but rewarding one.  The character of Bix is a shameless attempt at inserting the typical young reader into the story and it is very effective.  

Starblazer 210 - Dragonslayer - The Qerk!

I particularly liked the addition of the 6 legged scorpion tailed one eyed mini beholder creature which I will endeavour to write up a stat block for Savage Worlds and I will now forever call it a QERK!

Starblazer #211 - The Dream Machine

Starblazer #211 - The Dream Machine - Kayn's the name, and finding people is my game.  Actually, I'm a private investigator, but I spent most of my trime trying to find enough creds to pay the rent.  Then one day I got a request for help... from a guy who'd been dead five years!

Kayn is back in another mystery chase murder story.  Futuristic Moscow is such an off choice for a setting.  I guess it's so that you can get away with simple brutalist architecture and a unbendening robotic state aparatus.  

Needles to say our hero Kayn is completely oblivious to the machinations of the secretive villain in this story.  He learns everything piece by piece at the same time as you read every frame.

Definitely a comic of its time with a run of the mill Starblazer storyline which is not all bad but very average. 

Starblazer #212 - Rogue Cop
Starblazer #212 - Rogue Cop - Renko was a patrolman in a society diseased by corruption.  When this corruption touched him, he turned rogue to bring the offenders to justice.  But society doesn't like rogue cops and Renko was hounded to the edge of oblivion.

I was expecting a Robocop knock off but what I got was an interstellar crime wave and a man rescued from the brink of death by Space Brocolli!!

This is quite a fun little story, a classic tale of copy who goes rogue to bring down the big crime boss.  With no backup his luck runs out and he is stranded in the void with no hope so he decides to end it all by setting his ship to self destruct... as you do.

Saved by the benevolent space brocolli the Shreel, they turn him into a cyborg monster sending Renko into a depressive tailspin.  Howver, vengeance is a powerful emotion and Renko uses it to gain control of his new robotic body and take the fight to Hengis Furgaar to destroy his criminal emire once and for all.

Starblazer #213 - Skarr the Soldier
Starblazer #213 - Skarr The Soldier - Stranded in Samek, many thousands of miles from his home, Skarr, the soldier of fortune, had to fight for a foreign ruler and an alien cause - or be executed!

This is a fairly stock story of a man caught between two factions waging a war at all costs.  There is not much exposition only action and it really does seem like an exercise in getting as many wild character illustrations on a page as possible.

This a treat from the fine pen of  Enrique Alcatena with an epic cover from the legend Ian Kennedy.

The character art is wild from the weird almost Napoleonic uniforms of the Margolian army to the down right bizarre mix of kimono clad Tarcils and the mask wearing denizens of Hetamec.  

This is my first Skarr story and I am encouraged to find the others.  

Whilst the plot does not offer much for the Roleplayer or DM, the artwork is a smorgasbord of inspiration.

Essential Starblazer Links

The Starblazer Checklist is a fantastic resource if you are collecting or want to know who wrote and illustrated each issue.

Many thanks to the chaps who run the Starblazer Covers archive, this is immensely useful resource when looking at ebay joblot listings.

Retro Sanctuary has a great article covering his top 20 Starblazer Issues which is worth a look and I'm looking forward to reading and reviewing some of these classics in the very near future.