Skip to content
  • Home
  • Account
  • Restricted content
  • OBEX
  • Chips Tips
  • Logout
  • Shop
  • QuickBytes
Propeller OBEX
  • OBEX
  • Forum
Login
Propeller OBEX

Propeller 2

  • Configuring Visual Studio Code for Programming the P2 on Mac, Windows, and Linux
  • Breakout Board Options for P2 Edge Modules
  • Solar Panel Monitoring Demo (Intro to Using Video 3 of 3)
  • Wireless Programming with the ESP8266 WX Module
  • Brushless DC Motor Control Demo
  • Colorful Terminal Output with ANSI Escape Sequences
  • XBee RF Transparent and API Mode Demo
  • DS3231 Real Time Clock I2C Demo
  • Multiple Servo Control (up to 64) Object
  • Multiple Serial Port (8 UART – 16 Tx/Rx) Object
  • Goertzel Operation with Ultrasonic Transducers
  • Web Page Control of WS2811 LEDs Using the IoT Gateway on Raspberry Pi
  • 320×240 LCD Driver for ILI9341 Controller and XPT2046 Touch Screen
  • Digital Sample ADC to DAC + Analog Frequency to DAC
  • Using Smart Pins to Measure Frequency Output of TSL235R Light-to-Frequency Sensor
  • Ping))) Ultrasonic Distance Sensor with Graphical Debug Demo
  • Simple Analog Input
  • P2 Edge 16 MB Flash Reader and Explorer Utility
  • LED Matrix used as an I/O Test Utility
  • Arlo Conversion to P2 with the Universal Motor Controller
  • Five Buttons On One Pin
  • P2 RTC Add-on Board Demo
  • Simple Video Driver – Using Images (Intro to Using Video 2 of 3)
  • Starting Your P2 Project with a Spin2 Template
  • E-Ink Display Demo
  • MAX7219 LED Display SPI Demo
  • DHT11, DHT22, CM2302 Humidity and Temperature Sensor Object
  • NMEA GPS String Parsing
  • Floating Point Math: DEBUG and Terminal Display Example
  • LEDs – Beyond the Basics
  • Quadrature Encoder Object
  • P2 RTC Add-on with GPS Module
  • DVI/VGA Text Driver Demo
  • PCF8574 I2C LCD Demo
  • Simple Sound Engine Demo
  • 1-Wire Driver with DS18B20 Temperature Sensor Demo
  • Send Email from the Propeller 2 Using the IoT Gateway on Raspberry Pi
  • I2C Device Bus Scanner Utility
  • 32-Channel ADC Object
  • Tetris
  • Video Hardware with Character Map Demo (Intro to Using Video 1 of 3)
  • WS2811, WS2812, WS2812b, WS2813, SK6812x NeoPixel Object
View Categories
  • Home
  • Docs
  • Quick Bytes
  • Propeller 2
  • Tetris

Tetris

Reading Time: 2 min read


Description #

Tetris was contributed by forum member Rayman, and incorporates the Ahle2 simpleSound engine. This code was written in C with FlexProp, and incorporates the use of Spin2 files for video, mouse and keyboard.

The hardware is a Propeller 2 board with the P2 Eval A/V Breakout Add-on Board for audio and VGA. In this configuration, you play through the FlexProp terminal with your computer’s WASD keys. You may also use a USB keyboard and mouse connected to the P2 Eval Serial Host Add-on Board. 

Open the Platform.h file from FlexProp to configure your own I/O pins:

'//Note:  You must currently edit vga driver to set the base pin
    #define AV_BasePin 0  //Base pin for A/V expansion board connected to Eval Board
    #define AV_LeftPin (AV_BasePin+6)
    #define AV_RightPin (AV_BasePin+7)
    //USB pin definitions Parallax USB adapter board for P2 Eval Board
    #define SERIAL_HOST_BASEPIN 16
    #define USB_BASE_PIN (SERIAL_HOST_BASEPIN+0) 
    #define USB_ENABLE_PIN (SERIAL_HOST_BASEPIN+1)  
    #define USB_DM_PIN (SERIAL_HOST_BASEPIN+6)  //USB is on +6 and +7 for lower port, +2 and +3 for upper port
    #define USB_ERR_LED_PIN 57       //Using P2 Eval board's P57 led for error display
    #endif // Board_Eval

Thank you to Rayman for this entertaining contribution to P2 Quick Bytes! 

Parts Used #
  • P2 Edge Module
  • P2 Edge Breadboard
  • VGA Display
  • P2 Eval A/V Breakout Add-on Board (#64006H)
  • P2 Eval Serial Host Add-on Board (#64006B)
Source Code #
  • Tetris_1c.zip
Programming Language #
  • C
  • Spin 2
  • PASM2
Tools and Operating System #
  • FlexProp for Windows, Mac and Linux
Additional Resources #
  • Tetris in 1080p VGA with music and sound (P2 discussion forum)
  • simpleSound - A simple to use sound engine for the P2 (P2 discussion forum)
Document Author #
  • Ken Gracey (from Rayman)
Source Code Author #
  • Rayman
Was this useful ?

Share This Article :

  • Facebook
  • X
  • LinkedIn
Still stuck? How can we help?

Still stuck? How can we help?

Updated on September 29, 2026
32-Channel ADC ObjectVideo Hardware with Character Map Demo (Intro to Using Video 1 of 3)
Table of Contents
  • Description
  • Parts Used
  • Source Code
  • Programming Language
  • Tools and Operating System
  • Additional Resources
  • Document Author
  • Source Code Author

Copyright © 2026 - Parallax Inc.
599 Menlo Drive | Rocklin, CA 95765 | USA