Light

Emitting

Drawings

Group Members: Sarita Phoosopha, Lekha Adari, and Crystal Eskander

Initial Proposed Project Idea

To use a Wii Nunchuk with a USB adapter as a drawing tool to light up specific LEDs in order to display an image, which will be done by connecting a Wii Nunchuck to the LPC-4088 using a USB adapter. The user will maneuver the Nunchuk’s joystick to design their image on the 8x8 LED Display screen.

Final Project Idea

Use the joystick on the LPC4088 as a controller for an 8x8 GPIO LED Matrix. The 8x8 GPIO LED Matrix will initially light up an LED corresponding to the temperature in the room, which will use the temperature sensor on the LPC4088. Then the user can move the joystick on the LPC4088 to move the lit LED on the Matrix.

Week 2 (March 3 - March 9)

We tried to interface our Wii Nunchuck using a USB adapter. However, after several attempts of trying to interface it with the LPC4088 we have seen that it would not be feasible given our time constraints and our current knowledge of interfacing the Nunchuck with a USB adapter. As the example code for nunchucks that we found was all for I2C, and we had many difficulties trying to adapt that example code with USB.

Thus, we have decided to use the built in joystick on the LPC4088 to act as a controller for our LED matrix. We were successfully able to interface the joystick to the LPC4088.

Additionally, we were initially going to connect our 8x8 LED through the I2C interface; however, after several trials we were unable to appropriately connect the 8x8 LED matrix through I2C. We ran a probing function through our LPC to locate and address the LED Matrix that we had connected to it via a cable. However, the probing function could not locate the matrix, and thus did not return an address that corresponded with the matrix. Furthermore, we realized the LPC was unable to recognize the LED Matrix as a peripheral. Therefore, we decided to order different LED Matrices that will interface with the LPC via GPIO pins as opposed to an I2C backpack in order to avoid these issues.

8x8 LED Matrix: https://www.amazon.com/SenMod-Common-3-75mm-Bright-CL1588BS/dp/B01JYHMLJC/ref=sr_1_3?keywords=LED+matrix+8x8&qid=1552889788&s=gateway&sr=8-3

Week 3 (March 10 - March 16)

Our 8x8 LED matrix pin configuration did not come with a datasheet for the specified pins, so we had to rewire the pins on the breadboard so that they would correspond to the rows and columns of the matrix more intuitively as shown below on the left. We have successfully configured our 8x8 LED using the GPIO pins from the LPC4088. Our LED matrix turns on with a voltage of 1.5V or higher and with a current of at least 250mA. The LPC4088 gives out about 3.3V and 250mA so with these figures the LED matrix was able to light up. We have also enabled the pins to activate depending on our joystick movements.

Additionally, our plan was to be able to have the user draw on the LED matrix and be able to highlight the certain columns or rows that the user ran the joystick over. However, with the way that the LED matrix is configured it does not allow us to turn on specific configurations of rows and columns.

To turn on a specific LED on the LED matrix we have to make the pin that is connected to that column high and the pin that is connected to that row low. With this sort of configuration it is not feasible to be able to turn on a group of LEDs without having the whole row or column off.

Thus, we have implemented it such that we initialize the rows to have a high voltage and the columns to with a low voltage. This will be the starting state that the LED matrix will start as off. We implemented the initialization of the rows and the columns by setting the GPIO pins to be OutputPins and we used the WriteBitPort GPIO function. Then when we want to turn on a specific LED we would make the column high and the row low, we implemented this using the SetPinState GPIO function.

We had a difficult time deciphering which GPIO pins to use, but we were finally able to connect them to the LCD databit GPIO pins. As many of the other GPIO pins that we initially connected to were either specified for another input or were not outputting the expected result. We made it such that Port1 would correspond to the columns (Pins: 20, 21, 18, 23, 24, 26, 28, 29) and Port2 would correspond to the rows (Pins: 0, 1, 2, 9, 12, 13, 6, 8). We had to find 16 GPIO pins to turn on each light on the LED as there are 8 rows and 8 columns. We also put the corresponding rows and columns indices into an array so that they are easier to reference and address throughout the code.

For our joystick we have noticed that our left and right movements of our joystick do not work. In order to combat this issue we will replace the left joystick commands by pressing down on the joystick. The right joystick command works sporadically; it is not reliable. But the left motion is circular, so we can still access the right most parts of the matrix as desired. The joystick also requires debouncing in order to prevent the joystick handler from reading the joystick state even though it was not moved. The time for debouncing is crucial because if it is longer, the movement of led from on to another, via joystick, is not seamless. We have mapped the movement of the joystick with its binary number and have noticed that in order for the correct LED to light up we have to have a range of binary numbers for the left and right sides of the joystick to correctly display the lit LED, as shown below.

Furthermore, we have accessed the temperature sensor using I2C such that the initial configuration of the LED matrix corresponds to the current temperature (e.g. row 2, column 4 = 24 degrees celsius). The LED Matrix is able to light up the LED that corresponds to the temperature through the I2C polling method, as shown below:

We have also attempted to implement UART to print where the lit LED on the matrix was, but this would impact the lit LEDs on the matrix. It would cause large delay between the joystick movements and the lit LED. Thus we have decided to just print the location of the lit LED with printf statements through the terminal.

Thus, when the program is run on the LPC4088 the LPC4088 will read the temperature and the LED that corresponds to that temperature will light up. Then the user can move around the light that is lit on the LED by moving the joystick. The location of where the lit LED is will print on the LPC Expresso.

Final Week

Prepare for our presentation and debug.

Demo Video: https://www.youtube.com/watch?v=fUWt8uNuPZw&feature=youtu.be