2/21 - Parts have been ordered
2/27 - Preparation
exposing wires from Wii Nunchuck to be used in I2C connection
setup 8x8 LED Matrix (slight complication: found out that our 8x8 LED is I2C based)
possible solutions for meeting project requirements (Lab 3 Inspired) :
interface with the STM32L4 discovery board (UART)
produce red/green light whenever a "dot" is eaten by the "pac-man"
(same concept as 1) interface with the HC-05 bluetooth module (UART)
interface with the L3GD20 gyroscope (UART)
another form of being able to move "pac-man" around
3/6 - Setting up custom libraries to be used for general usage
we realized that the LED matrix libraries (from the mini I2C backpack that came with it) are Arduino-based and so we had to write our own implementations to be able to access the properties of the matrix
we still have the problem of having 2 I2C peripherals and not having a different one
we may have to purchase a new matrix that interfaces using SPI in order to avoid this problem
the wii nunchuck was interfaced with the STM board by way of I2C
following the datasheet, we were able to figure out the addresses for initialization and how to read values from the nunchuck
based on what we stated as possible solutions in the 2/27 update, we are leaning towards using solution 2 to solve our problem of having an insufficient amount of communication methods
3/13 - Finishing up wii nunchuck w/I2C and interfacing with termite through UART
we were able to avoid a collision in GPIO pin usage between I2C and UART by using PA2 and PA3 of the STM board instead of the original PB6 and PB7
our original wii nunchuck was stripped and we found there were some complications with wire connection and so we decided to connect the wii nunchuck to the "nunchucky" which is a wii nunchuck breakout adapter
we have attained all the macros of the wii nunchuck buttons/joystick directions
the initialization sequence was found and the read function was also created
this is still undergoing some testing as we are stuck on being able to actually interface with I2C (*hoping to finish before saturday)
after further research into our LED matrix, it seems as though we will not be able to connect it with the STM board as easily as we thought
we understood that it was made compatible with the Arduino UNO, but we thought that we could convert the code to work
due to these complications, we believe that the pac-man game could be represented in these such ways:
display a matrix on termite that updates every time we input a button or joystick press on the nunchuck
code the game on the computer and have a program that maps joystick inputs into keyboard presses
3/19 - FINISHED
our code for the wii nunchuck was actually entirely correct, but unfortunately we found out that the nunchuck we purchased was a knockoff and therefore the slave address was not defined as expected
this set us back for the past few weeks, because we couldn't find the issue
this week we were able to finish the project as a whole, but more specifically these things:
solder the wii nunchucky with 4 header pins in order to make for ease connection between the board and the nunchuck
interface with the wii nunchuck through UART and successfully print out "left, right, down, up" statements to terminal
write a python script that will read from the serial com port (which is what UART will print to) and convert those inputs at the com port to key presses on the keyboard
code a python game that resembles pac-man in which there is a user-controlled "pacman" and there are "dots" that need to be picked up while "ghosts/enemies" randomly move and you try to avoid them
code description:
main.c/uart.c/i2c.c - initialize I2C and UART on the STM board in order to communicate with the wii nunchuck and print out its inputs
keypress.py - convert wii nunchuck inputs to key presses
pacman.py - actual game that is played on another terminal (from keypress.py)