Skip to content

Chess clock for adafruit featherboard with circuitpython

Notifications You must be signed in to change notification settings

spkuehl/chess-clock

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Chess Clock

chess-clock is a CircuitPython library for creating and controlling a chess clock.

This library handles both the software and hardware implementation.

Created with CircuitPython v5.3.0 on an Adafruit Feather M0 Express - Designed for CircuitPython - ATSAMD21 Cortex M0

Installation

Clone the repository.

If your hardware needs the memory optimized it is recommended to convert timer.py and chessclock.py to .mpy files. (mpy guide)

Copy CircuitPython dependancies for the Featherwing 7-segment display on your Featherboard M0 w/ CircuitPython. (dependancy guide)

  • adafruit_ht16k33
  • adafruit_bus_device
  • adafruit_register

Copy code.py,timer.(m)py and chessclock.(m)py to your CircuitPython device.

Hardware Overview

1 x Featherboard M0 w/ CircuitPython

2 x Featherwing 7-segment display

3 x Buttons (Left side, right side, power/reset)

1 x Lithium Ion Polymer Battery (recommended)

1 x Large Breadboard w/ jumper wires

Hardware Instructions

Assemble and solder the Featherboard and Featherwings following Adafruit specifications. (7-segment display assembly guide)

Set up unique i2c addresses for the 7 segment displays. (address shorting guide)

Fritzing Example

Real Example

Usage

Configure your clock as desired in code.py.

player_1 = chessclock.ChessClock(time_left = 60,
                                 display = segments.Seg7x4(i2c),
                                 pin = DigitalInOut(board.D6),
                                 increment = 5)

player_2 = chessclock.ChessClock(time_left = 60,
                                 display = segments.Seg7x4(i2c, address=0x71),
                                 pin = DigitalInOut(board.D5),
                                 increment = 5)

Clock will start after a button is pressed. When the active player presses their button, their timer will pause (and an increment will be added if applicable) and the other player's timer will start.

Timers will continue counting down while active until one side hits 00:00, indicating game over by time out.

Contributing

Pull requests are always welcome. For major changes, please open an issue first to discuss what you would like to change.

Fork > Clone > Branch > Make Changes > Commit > Push > Pull Request

About

Chess clock for adafruit featherboard with circuitpython

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages