Wednesday, December 11, 2024

Nooooo, don't make me reflect on my learning!

 ... I just want to stick wires in breadboards and make froggies dance!!!

Okay, but seriously, that stupid dancing frog was clearly my most proud moment of the semester.  I had to use Tinkercad, which was totally new to me, and it also involved using other people's existing sketches and modifying them for my own.  I also had to use our new 3D printers at MCC, which was also semi-disastrous (I managed to clog the best-working one right after I finished).  I also had to take a breath and realize it was okay if it wasn't "perfect" insofar as getting the math scaling right.

At the beginning, I was irritated we were going to have to learn to use Arduino - I had skillfully made great excuses for not learning it for about 15 years now and had no intent to stop - but here we were.  Ugh.  I will say that Tinkercad was a Godsend because if all I could do was just experiment with the physical equipment I think I would have given up much earlier.  Being able to "prove" to myself that at least, in theory, the circuit should work gave me the courage to try and get it to work in reality.  Then later, when Tinkercad couldn't keep up with what I was doing (I'm looking at you, stupid motor), I was confident enough-ish that I could go straight to the board (having tested out the code in another way in Tinkercad).

I enjoyed looking through the book, and not letting myself just "get by."  Paulina made me take this class (because she's a super-meany), and I absolutely 100% did not have time for it.  But of course as soon as we got into it, I was hooked.  I'm never going to see myself as a "real-life-maker-person" because there are just too many highly-competent individuals around me, but I feel like I can at least be a Poser.  Like, I can say, "Yeah, you know, this one time when I was trying to get this servo working with my Arduino...." but then if anyone asks, "did you try flashing your blahblahblah," I'll just turn into a pile of bubbling garbage.

In general, looking back, I see someone gaining confidence throughout a short 8-week semester, but honestly it would not have been possible had I not already had a strong background in programming and a reasonably-decent background in CAD.  (Paulina is our CAD and 3D printing expert, and I was just trying to channel her.)  

I always tell my students, "You never learn anything until the third time you see something."  I've had two other opportunities where I've programmed an Arduino and had no idea what was going on.  True to form, this is the time I finally yielded and decided, "okay I can't hide anymore, I've got to actually try to learn this."

I don't know what lies ahead for me in my maker world -- probably fixing the 3D printer, which we've named Peanut, before Paulina yells at me (she always makes me cry!!) (no, not really, just checking to see if she's reading this, lol), but she will give me a Disappointing Look if I don't get it working again and I wither under that gaze.  I am really excited about building the Engineering Commons with Paulina and ****maybe**** I might be brave enough to try soldering.  But I still need to attempt it two more times....




Friday, December 6, 2024

Final Maker Challenge: A Dancing Frog!

This week I was inspired by a Tinkercad post about using a motor to make a 3D printed creature move around.  https://www.tinkercad.com/projects/Evolution-Games-Building-Creatures-With-Basic-Elec

The little creatures looked really cute, and I thought I could probably get this working with a photoresistor so they would go faster when it was bright and slower when it was dark.  Ah, me of the beginning of this week, you were so naive....

Clearly I can make this work with this cute little baby Arduino I found in a box!

I had done a PD session a few years ago and I remembered it had some circuit-y stuff in it.  Opening it, it had an Arduino-something but also this teeny-tiny Arduino, called an Arduino Nano.  This is perfect, I thought!  I can mount this directly onto the animal and then make it battery powered and I won't have to worry about wires and stuff.

Seriously, look how cute this is!


Okay, so it actually runs with a mini usb.  Not even a micro, but like one of those ones that looks like two different-sized rectangles on top of each other.  So this was kind of old.


By the time I used my USB to USB-C converter for my laptop, there was too much lost in translation, so I headed over to my daughter's paint-splattered computer.  She still has the old-school USB ports and I got the Arduino IDE working on it.  Without too much effort, I was actually able to load a pre-built program and make the servo work!


I actually still have it connected to the large breadboard, but it worked!  Awesome!  The next step was to move everything to my tiny breadboards that I had and make it work with the motor.  Everything was wired up, the code was ready to go, and .......... nothing.


I uploaded the code, it seemed happy, but then it did nothing.  I went back to the servo code that I knew worked from last week, and still got nothing.  After some extensive troubleshooting, I realized the only code I could get to work on this Nano baby was the pre-built code that came with the Arduino IDE, and if I tried to do anything from scratch it got very, very mad at me.

"Dear ChatGPT, Why would my Arduino Uno code not work on my Arduino Nano?"

There are several reasons your Arduino Uno code might not work on an Arduino Nano. Here are the most common issues to check:

1. Board Selection in Arduino IDE   ... nope

2. Pin Differences  ...nope

3. Voltage Differences   ...nope

4. Memory or Resource Usage   ...nope

5. External Components   ...nope

6. Library Compatibility   ...nope

7. Faulty Nano or Bootloader Issues   

  • Test your Nano with a simple sketch like the "Blink" example to confirm it is functioning correctly.
  • If the Nano has an old or corrupt bootloader, it might fail to execute the code. You can re-burn the bootloader using another Arduino board as a programmer.

...oi, so yeah, I'm not emotionally ready to "re-burn the bootloader"... whatever that means

Guess I'm going back to using the Big Giant Uno Board.

While that's going on, let's try some 3D printing

I went to the Tinkercad website and copied the bunny and frog models.  I deleted the insides because they were built for a differently-shaped motor than the one we have, and took them to the 3D printer.


They came out pretty cute, actually!  I brought them home to play with, and of course, the motor really needed a holder.  I was able to make one in Tinkercad based on what I'd learned when I'd used it for making a model of my Makerspace earlier this semester, so that felt good.


But again, of course when it was time to pull everything together, the holes in the spinner things were too small, and the motor holder was too big for the frog and too small for the bunny.  Another day, another trip to the 3D printers to try a few more designs, until I finally got everything fitting together.



Wiring this just for the motor should be totally easy!

Since I still hadn't gone to pick up the photoresistor yet, I decided just to get it going with the motor.  Problem 1 was again trying to tell the difference between the temperature sensor and the transistors.  I don't know how people did stuff like this without cell phones and zooming in.  I guess magnifying glasses?  Ugh.

I got everything wired up, but dang, it seemed really weak compared to what I had been expecting, and since I had been hoping to decrease the motor speed based on the light, this really didn't seem like it could handle going much slower.  I could hear the motor trying to gear up, but I had to give it a nudge half the time to get it going.



I also had a fun experience watching Bunny say, "No, thank you."


Let's take a look at this wiring

Oh my, it appears I've flipped the diode and the resistor.  My setup was right on Tinkercad, but somehow even though I'd wired it wrong, it was still working.  


What a relief, and what an easy fix!

Right?

       Right???

                     Right???

Of course not, that would be silly.  And how would I ever have any fun practicing all my bad language if everything went right all the time???

Once I flipped the diode and the resistor, the motor stopped spinning entirely. I could hear it engage, but it wouldn't spin.  I thought maybe I'd "fried" something, so I switched out the diode, the resistor (I'd actually had the wrong resistance anyway), and the transistor, but still nothing was working.  I connected the motor directly to the power and ground bars to make sure it still ran, which it did, but man, I could not figure out what was going on.

Then I figured it out.


Let's see this froggy dance!

The motor was clearly much stronger now, and she was dancing like there was no tomorrow!  Since my next goal was to add the photoresistor, I wanted to make sure she'd still run at a lower power.  I adjusted the code to alternate between a low motor speed and a high motor speed.  I also tried getting some of the wires out of the way to see how far she might travel.


I decided to focus on the frog because the motor was a tighter fit for her, so she got better motion.  Given the time constraints, I figured in retrospect I could pretend that's why I was trying two different things at once anyway - just so that I could actually maybe get one working!

Adding the photoresistor should be super easy now....

I confidently moved into the "adding the photoresistor" phase. Wiring it up wasn't too bad because I'd done that before in previous projects.



But when I was playing with it with Tinkercad, I noticed that when the photoresistor was at half, the motor was still close to 255, so I decided to ask ChatGPT.  I copy/pasted my code, and then asked this terribly-worded question:


And it gave me this code snippet to try:

// Apply non-linear correction (example uses square root to flatten high values)
  float normalizedLight = (float)(lightLevel - lightLow) / range; // Normalize to 0-1
  normalizedLight = constrain(normalizedLight, 0.0, 1.0); // Ensure within bounds
  motorLevel = pow(normalizedLight, 0.5) * 255; // Example: sqrt correction for light non-linearity

Yeah, but that didn't quite work.  I thought maybe having it done in "real life" would help, since Tinkercad has become less reliable the more complex my projects have become, so I put together the breadboard.  As a math person, I started to obsess a little much about how when half the photoresistor was covered, it didn't give me half the value, and I spent way too much time trying to "math" myself a solution.



Then I realized that no one was going to care if the frog was dancing at 85% effort when they really should be dancing at 75% effort and I needed to let this one go.  

I did a few more tweaks to the code as well, because when the motor speed was sufficiently low (like below 100), you could hear the motor trying to spin up, but not being able to actually do so.  I added some code to ignore low motor spin values.

  if (motorLevel > 100){
     motorOnThenOff(motorLevel);
  }

It's time for my closeup!

Froggy was ready to party.  I gave her a glam-up in Tinkercad so she wouldn't have such a boxy head, and also made her counterweight a fly, because I thought it was cuter that way.  



I used my daughter's acrylic paints (remember the paint-splattered computer??), and once everything dried we were ready to go!


My husband ran the lights and my puppies provided the background music.  The light-to-motor connection is on an (intentional) three-second delay so it'll still dance a little bit after the lights go off and won't start right away when the lights go on.  You can also tell that it will dance "faster" when the lights are really bright and that it will dance less enthusiastically when the lights are on but dimmer.  Hope you enjoy!



All the extras

Here is the circuit diagram!


And here is the code!

// We'll be controlling the motor from pin 9.
// This must be one of the PWM-capable pins.
const int motorPin = 9;
const int lightInputPin = A0;

int randomNumber;
int buttonPin = 2;
int buttonState = 0;


// We'll also set up some global variables for the light level:
// I initially set them at 300 and 400, but will allow them to
//   change based on what happens in the system
int lightLevel, lightLow = 400, lightHigh = 500;

void setup(){
 
  // Set up the motor pin to be an output:
  pinMode(motorPin, OUTPUT);
  pinMode(buttonPin, INPUT);
 
  Serial.begin(9600);
  randomSeed(analogRead(0));
 
} // end setup()

void loop(){

  Serial.println("Light Level:");  
  Serial.println(lightLow);  

  double motorLevel = lightLoop();
  if (motorLevel > 100){
     motorOnThenOff(motorLevel);
  }
} // end loop

void motorOnThenOff(double speed){
  analogWrite(motorPin, speed); // turn the motor on (full speed)
  delay(3000);

  Serial.println("Off");  
  analogWrite(motorPin, 0);  // turn the motor off
} // end motorOnThenOff


float lightLoop(){
  int range = lightHigh - lightLow;
  float motorLevel;

  lightLevel = analogRead(lightInputPin);
  Serial.println("Light Level:");  
  Serial.println(lightLevel);  

 
  if (lightLevel < lightLow & lightLow > 35) {
    lightLow = lightLevel;
  }
 
  if (lightLevel > lightHigh) {
    lightHigh = lightLevel;
  }

// Apply non-linear correction (example uses square root to flatten high values)
  float normalizedLight = (float)(lightLevel - lightLow) / range; // Normalize to 0-1
  normalizedLight = constrain(normalizedLight, 0.0, 1.0); // Ensure within bounds

  motorLevel = pow(normalizedLight, 0.3) * 255; // Example: sqrt correction for light non-linearity
 
 
  Serial.println("normalizedLight:");  
  Serial.println(normalizedLight);  
  Serial.println(":------:");

  Serial.println("Motor LEvel:");  
  Serial.println(motorLevel);  
  Serial.println(":------:");


  return motorLevel;


} // end lightLoop



Friday, November 29, 2024

Week 6: Flipping the Blinds

I was happy that I struggled so much with servos last week, because this week I knew going in that the servo wasn't going to go more than 180 degrees.  With that in mind, I started thinking about how to physically open and close the blinds using the servo.  I didn't use the photoresistor this time because (a) I'd already used it on past projects and felt comfortable with it, and (b) my kit actually didn't come with one, and I had only had access to one because of a kit I'd checked out from our library... which I'd already returned.

That said, I decided just to stick with the push button and focus on the servo and the physical aspects of getting the blinds to move.  My house has the blinds like these where you can twist the rod to tilt the blinds or pull the string to make them go up and down.  

I didn't think I could get the mechanics of the "up and down" part because for down you have to pull the cord off to the side and that seemed really complicated so I decided to go with the twisting part.  I tested it and found that the rod needed to rotate seven times in order to go from open to closed.  That was definitely going to be an issue with having a servo that could only go 180 degrees, but I thought maybe not insurmountable if I just used gear ratios.


Business as usual: Tinkercad

As per my standard operating procedure, I set up my model on Tinkercad, and got things working:


The code was relatively straightforward as well, since I already had programmed the button and had programmed a servo before.  But for some reason, I absolutely could not get the thing to work.  A seemingly-infinite amount of time later, I finally realized I was missing a reference.  I had this code:

servoBase.attach(A1);

and it should've been this code:

 servoBase.attach(servoPin);

So that was an hour of my life I wasn't getting back!  I now had working code and everything was going to be perfect.  I had it set up so that each time I pushed the button the servo either ran 180 degrees clockwise or 180 degrees counterclockwise (opening or closing the window).

#include <Servo.h>

Servo servoBase;
// We'll be controlling the servo from pin A1.
const int servoPin = 10;

int buttonPin = 2;
int buttonState = 0;
int goCW = 1;

void setup(){
 
  pinMode(buttonPin, INPUT);
 
  servoBase.attach(servoPin);
  servoBase.write(0);  

  Serial.begin(9600);

} // end setup()

void loop(){
 
  buttonState = digitalRead(buttonPin);

  if (buttonState == HIGH) {
    Serial.println("Button Activated");  
    if (goCW == 1){    
      goCW = 0;
      servoCW();      
    } else {
      goCW = 1;
      servoCCW();
    } // end CW or CCW
  } //end if

} // end loop

void servoCW(){
  Serial.println("In Servo CW");  

  for(int i=0; i<=180; i=i+10)  {
   Serial.println(i);  
   servoBase.write(i);
   delay(200);
  }
 
} // end servoCW

void servoCCW(){
  Serial.println("In Servo CCW");  

  for(int i=180; i>=0; i=i-10)  {
   Serial.println(i);  
   servoBase.write(i);
   delay(200);
  }
 
} // end servoCCW

Next Problem: Nothing Uploads

Now being ready to upload the code to my breadboard I ran into a terrifying problem: the code would not upload to the breadboard.  Just wouldn't do it.  It compiled, everything was great, but then it just would not copy over to the Arduino.  

Clearly I'm just dumb and didn't connect things well.  Take out USB. Reconnect USB.  Try again.  No.

Clearly I just need to close the Arduino IDE and open it again.  Nope.

Clearly I need to the close the Arduino IDE, take out the USB, reconnect, the USB, then open the IDE again.  Keep trying, sweetie.

Okay clearly I need to do all that, plus restart my computer.  No dice.

Okay must just be this code.  Let's try uploading code from last week because we know that works.  But no, it doesn't!   Terror grips my soul.

Now we hit the forums.


I was able to confirm my Arduino board wasn't "fried" (thank all that is holy), but then resetting it still didn't actually help.  The next step on the forum was terrifying:

Okay so that was fun.


Good news is, it worked!  Now the code uploaded and I could breathe again. Everything's good from here on out, right?  Right?????

Pretend this isn't a problem: backwards button reading

For some reason, even though I hadn't changed anything else related to the button wiring in my code or on my breadboard, the button state was reading high even when it wasn't pressed (and reading low when it was pressed).  

I tried using ChatGPT, by giving it my code and asking what might be going on:


It gave me quite a few ideas for troubleshooting:



I attempted all the suggestions, including this one:

Change pinMode(buttonPin, INPUT); to pinMode(buttonPin, INPUT_PULLUP);

That still didn't work, so I changed the code to look for LOW instead of HIGH and just moved on.


Let's do this: The gear setup

It was time to pull out the Legos and some 3D printed gears I had lying around.  First, I made a little holder for the servo.


I got everything wired up and put together the servo system.  Success!


And because the Karma Gods are fickle, the screw that came with the box for the servo wasn't long enough to go through the gear and the servo.  Luckily I found a screw with the same diameter and just a little longer!


I put the gear on the servo, and then put together another two gears so we could get a better gear ratio (180 going to 270).  It wasn't great, but it looked like an okay-enough set up.


Now confident I could do this, I set out to start adding pairs of gears until I got my gear ratio to make the full 2520 degree (7 revolution) setup.




Things looked good - time to make it spin!


And... this is where the dream died.  I realized couldn't get the precision on the gears, and that even if I could, I wouldn't be able to get enough power on the servo to make all those rotations.

So all that work just to discover another way to not make a lightbulb...

I had one more trick up my sleeve.

Let's do this (again): The moment arm setup

My son's apartment has different kinds of blinds, that instead of a rotation just use a string pull to made the blades rotate.  I thought I might have a chance.


I got a paint stirring stick, drilled a hole in the middle to attach to the servo and drilled two larger holes on each end for the strings of the blinds.  If the servo could do the 180 degree rotation with each string on each side, it would fully open or close the blinds.


Now let's see how this turned out...



So essentially, the servo that came with the kit just wasn't strong enough to handle either set of blinds in my house.  I do feel like I have a "proof of concept" in that if I got a stronger servo, I might have been able to make this happen!  

(As I was lamenting my struggles, my father-in-law suggested a real-world application related to toilet paper dispensing, which gave me giggles and lifted my spirits!)


Saturday, November 23, 2024

Week 5: Choose your own adventure!

This one was fun!  I decided I wanted to use the random number generator to make a roulette wheel style spinner (with only a few numbers, not all of them!).  I thought I could use the servo motor, because apparently you can tell that exactly where to go.  My theory was to generate the random number in the code, then spin the servo a little bit for show, and then have it rotate to the right number on the board.  Since it already kind of had a "pointer," I figured it wouldn't be too bad.

I got the servo out, and realized it had to be assembled.  I felt like kind of a pro at this point, because I got to use a screwdriver and that felt Real (as the kids these days would say).


First of all, it took a while to pinpoint exactly which servo we had in the box, but I finally found the right one and found a wiring diagram: 


But no matter what I did, I couldn't get it to actually spin.  Didn't even get to the random number part, I just kept going back and forth trying to get it to spin.  (This was all on Tinkercad.)  I thought maybe the simulation software just wasn't great, so I tried wiring it up for real, but it still wasn't working.  A few more hours on Google, and I came across this gem:


Apparently they can't do a 360 degree spin at all and I was working with the wrong hardware to begin with!  So yeah, that was a fun afternoon...

Okay let's try something else.  There was also a motor in the kit, but that seemed a little scary.  Motors spin fast, and they have all kinds of extra things you have to put on the board to make it work.  I did see a motor project in the book though, and found the related code in the zip file, so I decided to give it a shot.  (If you're interested, read the comments in the code about how the extra parts work, it's kind of crazy how much extra stuff is going on at an electrical level that we can just wire up by pattern matching and move on.)

I decided to forego the idea of getting it to go to a specific number, and just wanted to get the motor to spin.  There were a lot of extra functions in the provided code, so I deleted all but the "spin the motor just normally" one, and used what we learned previous to wire it up to go on a button press.  But still in Tinkercad it wasn't working great.  Again, out of desperation, I decided to forego the model and just wire it up for real, expecting to be yet again disappointed.  But no!  It actually worked!  Success!!!!!


Now we're cookin' with gas!

The next step was to build something to hold the motor so it could spin.  Out came the Legos.  I also wanted to attach the number circle on the motor, so I needed a little base to glue onto the motor.


Now comes out the hot glue gun that I've used about four times in the last twenty years, and a misleadingly-short-and-easy amount of time later, my device was ready to go!


Everything was ready, I clicked the button.... and the stupid motor started spinning so fast both the paper and the wooden disc flew right off!  Okay, so now I have to figure out how to slow down the motor.

I had to go back to some of those functions I had previously deleted, because I remembered one of them said something about motor speeds.  Turns out you can control the motor, from 0 to 255, just like you'd kind of expect.  So all I really needed to do was maybe cut the motor speed by 75% and reassemble everything.

Of course the wooden disc was now 100% clogged with old glue, and I couldn't get the paper numbers off without ripping everything and potentially making the one wooden disc I had unusable.  So now I'm trying to rip out 25 year-old dried glue out of a tiny hole without ruining something glued to the other side of it.  After a toothpick and tiny Allen wrench failed, I found success using a tiny shrimp cocktail fork.  Getting everything reset took about an hour, but finally I was ready to try again.


I put everything together, set the motor really low, and.... Nothing Happened.  I knocked it down about 50%, thinking that would probably be enough, but still worried it was too high.  Not only was it not too high, it didn't even spin.  I could hear the motor trying to engage, but it didn't move.  Oh, no, I broke the motor!  Okay, maybe I didn't, but let's just try increasing the number a little bit.  

Turns out that the motor isn't spinning on a power of 0 to 255.  It's actually spinning on a power from <whatever gets it going> to 255.  And with the weight put on the motor, this guy wasn't going to start spinning until it had a power over at least 160.  I was really wary of it going too fast, though, so I didn't experiment too much - basically increased the power until I felt it was "just enough" to give it a decent spin.

With that success, I wanted to put in a bit of randomness, so I also put in a spin timer based on a random number, so the motor would spin anywhere from 1 to 4 seconds.  (I actually generated a number between 10 and 40 and multiplied by 100 instead of 1 to 4 and multiplying by 1000 so I'd get a little bit more variability.)


Here is the final version of the code.  Comments at the top came from the project documentation (I deleted a bunch of the comments and just left the ones in about the hardware).  I could definitely see real-life extensions, even with just board games, so this was really fun to put together.

/*
SPINNING A MOTOR

  Transistor:
 
    The transistor has three pins. Looking at the flat side with the
    pins down, the order is COLLECTOR, BASE, EMITTER.
   
    Connect the black wire on the motor to the
    COLLECTOR pin on the transistor.

    Connect the BASE pin through a 330 Ohm resistor to
    digital pin 9.
   
    Connect the EMITTER pin to GND.
 
  Motor:

    You've already connected the black wire on the motor to the
    COLLECTOR pin on the transistor.
   
    Connect the other (red) wire on the motor to 5V.
 
  Flyback diode:

    When the motor is spinning and suddenly turned off, the
    magnetic field inside it collapses, generating a voltage spike.
    This can damage the transistor. To prevent this, we use a
    "flyback diode", which diverts the voltage spike away from
    the transistor.

    Connect the side of the diode with the band (cathode) to 5V
    Connect the other side of the diode (anode) to the black wire
    on the motor.
*/

// We'll be controlling the motor from pin 9.
const int motorPin = 9;

int randomNumber;
int buttonPin = 2;
int buttonState = 0;

void setup(){
 
  // Set up the motor pin to be an output:
  pinMode(motorPin, OUTPUT);
  pinMode(buttonPin, INPUT);
 
  Serial.begin(9600);
  randomSeed(analogRead(0));

} // end setup()

void loop(){
 
  buttonState = digitalRead(buttonPin);
 
  if (buttonState == HIGH) {
     Serial.println("Button state is 1");  
      motorOnThenOff();      
  } //end if

} // end loop

void motorOnThenOff(){
  int onTime;  // milliseconds to turn the motor on
  int offTime; // milliseconds to turn the motor off
 
  randomNumber = random(10,41); // Generate a random # from 10 to 40
  Serial.println(randomNumber);  

  onTime = randomNumber*100;

  Serial.println("On");  
  analogWrite(motorPin, 185);   // turn the motor on (full speed)
  delay(onTime);                // delay for onTime milliseconds

  Serial.println("Off");        // Don't actually need this functionality
  analogWrite(motorPin, 0);     // - just leaving it in there in case I want it later
  delay(offTime);               //   and it doesn't hurt anything

} // end motorOnThenOff

Thursday, November 14, 2024

Week 4 Extension - Try a 7-Segment Display

Since I found a seven-segment display in the kit I checked out from the library, I figured I would give it a shot!  Step one of course was to get everything on Tinkercard, and once I just copied over from what I found on a few online resources, everything worked perfectly!

Ah, what a lovely day -- I'm going to get things done early....

Nope.

Wired everything the same as Tinkercad.  Pressed button.  Nothing.

Rewrote code so not dependent on the button.  Nothing.

Checked security of all the wires.  Nothing.

Pulled out all the wires and put them back together.  Still nothing.

Time for bed, defeated and ashamed.

The next day, clearly I must've just done it wrong.

Pulled out all the wires and put them back together.  Still nothing.  This is getting old.

I started looking online for all the ways to test the display itself -- clearly the part must be broken.  Unfortunately all the troubleshooting tips required using a multimeter, which I don't have.  But while looking at everything, I realized there are two types of 7-segment displays: Anode and Cathode.  I moved the one resistor wire from the + to the - side and .... magic!  Didn't get anything that looked like numbers on the display, but it at least started lighting up.

I did some more looking around online, and went back to Tinkercad.  This video I actually talk through it, so if you normally have sound off, having the sound on might help.


And here we get the circuit diagram!


All kinds of fun, but it's working now!


And here's the code!  Right now it's just doing the numbers 1 through six, but it could be edited to also do 0 and 7 - 9.

unsigned const int A = 13;
unsigned const int B = 12;
unsigned const int C = 11;
unsigned const int D = 10;
unsigned const int E = 9;
unsigned const int F = 8;
unsigned const int G = 7;
unsigned const int H = 6;
int randomNumber;
int buttonPin = 2;
int buttonState = 0;

void setup(){

  int index;
 
  pinMode(A, OUTPUT);
  pinMode(B, OUTPUT);
  pinMode(C, OUTPUT);
  pinMode(D, OUTPUT);
  pinMode(E, OUTPUT);
  pinMode(F, OUTPUT);
  pinMode(G, OUTPUT);
  pinMode(H, OUTPUT);

  pinMode(buttonPin, INPUT);
 
  Serial.begin(9600);
  randomSeed(analogRead(0));
 
  delay(100);
 
} // end setup


void loop(){
 
  int index;
 
  buttonState = digitalRead(buttonPin);
 
  if (buttonState == HIGH) {
     delay(100);
   
     randomNumber = random(1,7); // Generate a random # from 1 to 6
     Serial.println(randomNumber);
  }
  delay(500);
  //randomNumber = random(1,7);
   Serial.println(randomNumber);
 
  switch(randomNumber) {
    case 1:
      one();
      break;
    case 2:
      two();  
      break;
    case 3:
      three();
      break;
    case 4:
      four();
      break;
    case 5:
      five();
      break;
    case 6:
      six();
      break;
    default:
      Serial.println("Nothing happening");
      break;
  } // end switch
 
} // end main loop

void zero(void) {
  digitalWrite(A, HIGH);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void one(void) {
   Serial.println("11111");
  digitalWrite(A, HIGH);
  digitalWrite(B, HIGH);
  digitalWrite(C, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void two(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, HIGH);
  digitalWrite(H, HIGH);
}

void three(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void four(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, HIGH);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void five(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, HIGH);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void six(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, HIGH);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void seven(void) {
  digitalWrite(A, HIGH);
  digitalWrite(B, HIGH);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, HIGH);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void eight(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, LOW);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}

void nine(void) {
  digitalWrite(A, LOW);
  digitalWrite(B, LOW);
  digitalWrite(C, LOW);
  digitalWrite(D, LOW);
  digitalWrite(E, HIGH);
  digitalWrite(F, LOW);
  digitalWrite(G, LOW);
  digitalWrite(H, HIGH);
}



Nooooo, don't make me reflect on my learning!

 ... I just want to stick wires in breadboards and make froggies dance!!! Okay, but seriously, that stupid dancing frog was clearly my most ...