Comments: Endless Runner Game

Pages

Comments 14 comments

  • Resolved! Thanks everyone for input and comments. One of my students figured out that we had flip-flopped some of the digital pins. Thanks to bboyho for the link to the code line with the LCD pins listed——–

    • bboyho / last month / 1

      I was able to recreate the issue and determine the root of the problem. I did not realize that one of your students had troubleshooted the issue. I’m glad to hear that it was resolved! I have updated the tutorial code and will be checking in with Shawn to update the gist. =)

    • Glad it worked out! I emailed bboyho to help out, as I was getting stuck. He’s always on top of stuff like this :)

  • We did successfully complete Experiment 15 “Hello World” —— so we can rule out components

  • Re-Built from scratch on a couple of different kits, moved wires, and checked for loose wires, etc. but the same identical weird graphics occur, that’s why I’m wondering if these earlier kits are an issue? My students and I can replicate this same problem each time. Cannot get any flowing graphic stream as seen in the videos.

  • Hi Shawn, let me see if I can share photo with you——- https://drive.google.com/file/d/13O3YyOAwf3bXMyXzf4rnI7bv65fmtaVN/view?usp=sharing

    • From what I can see, the wiring looks to be correct. Try moving the wires around or re-connecting things to see if there is a loose connection. A loose ‘E’ or data line can cause weird behavior like this.

    • bboyho / last month * / 1

      Sorry for the delay in reply. I was at the airport when I initially responded. Now that had some time to test the issue, I was able to recreate the problem. The issue is due to the pins not being initialized correctly [ check the Arduino LCD Library - https://www.arduino.cc/en/Tutorial/HelloWorld ]. One solution is to flip the wired connections for the LCD’s RS, EN, D4, D5, D6, and D7.

      The easier method would be to redefine the pins on line 52 from:

      LiquidCrystal lcd(13, 12, 11, 10, 9, 8);
      

      to:

      LiquidCrystal lcd(8, 9, 10, 11, 12, 13);
      

      I am adjusting the code in the tutorial and checking in with Shawn to adjust the gist repo. =)

    • Hmm, that’s odd. It’s hard to see from the images with some of the wires but I agree with Shawn, the wires appear like they are connected correctly to the circuit.

      Wires

      Maybe a wire is loose/bad or the breadboard? I have issues where there are black rectangles (“█”) and other odd characters in first row => https://learn.sparkfun.com/tutorials/sik-experiment-guide-for-arduino—v33/experiment-15-using-an-lcd when the wires loose or when someone touches the wires. However, it appears that you have already tried troubleshooting the wires and there is more than one student that is having the same issue.

      Code

      I assume that you are using the pin definitions provided in the programming section here [ https://gist.github.com/ShawnHymel/0f9a931209be4dd2271d4d2925e81e47#file-endless_runner-ino-L52 ]?

      I’ll need to try and test the circuit to the LCD to see if I can recreate the issue.

  • My classroom is not getting the same results as shown. It almost looks like the LCD is split horizontally, so half the characters. We are using an earlier SIK setup. 8 students and I get the same results upon seeing up the circuit. Any ideas would be helpful. Seems like we did all the standard troubleshooting.

    • What are you seeing on the other half of the LCD? Filled characters, garbage, blanks, etc?

      Double-check your wiring. Sometimes, a loose wire may cause bad communication or trick the LCD into thinking it’s in a different mode (e.g. 8-bit mode instead of 4-bit mode).

      Also, how many LCDs are you seeing this on? Do you have just 1 SIK or are there multiple SIKs exhibiting the same issue?

  • Hey, thank you very much:) I did, and it works !

    I have question about button. When i connect button to Arduino, i use resistor and 3 jumper wire. How did you do that with just 2 wires? Can you explain that?

    • When you attach the resistor to the button, you’re using what’s known as a “pull-up resistor.” The resistor is usually tied between your input pin (connected to one of the button pins) and your power rail (e.g. 5 V). When the button is not pressed, the resistor forces the pin’s voltage to go high, and when the button is pressed, the pin’s voltage goes low (e.g. GND). Here is a more in-depth explanation on pull-up resistors.

      Many microcontrollers, like the one on the Arduino, have internal pull-up resistors on most of their GPIO pins, and we can enable them in code. If you look at the code, you’ll see pinMode(BTN_PIN, INPUT_PULLUP);. The INPUT_PULLUP part enables the internal pull-up resistor on our button pin. This has (essentially) the same effect as attaching an actual resistor between the button pin and the power rail (5 V).


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!