You have two main parts: a Python script running on your computer and an Arduino connected to a 16 by 2 I2C LCD. The Python script opens the Bad Apple video and reads it frame by frame. Each frame is converted to grayscale and resized to fit inside a 48 by 16 pixel area without cutting off any part, so it keeps the correct aspect ratio. The frame is converted to black and white pixels, either on or off. The image is split into small blocks called tiles that match the LCD’s custom character size of 5 pixels wide by 8 pixels tall. Up to 8 unique tile patterns are sent to the Arduino. Then a map is sent that tells the Arduino which tile to show in each position on the 16 by 2 LCD screen. Before sending each new frame, the Python script waits for the Arduino to say it is ready.
The Arduino starts by telling the Python script it is ready. For each frame, it sends a message "NEXT" to request the data. It receives the tile patterns and loads them into the LCD’s custom character memory. Then it receives the map of which tiles go where on the screen and updates the display. This process repeats continuously to show the animation.
The communication works like this: the Arduino says "READY" when it is powered on and ready to start. For each frame, the Arduino sends "NEXT" to ask for the next set of data. The Python script sends the tile data and the tile map in response. This handshake keeps the data flowing smoothly without overwhelming the Arduino.
This works because the LCD can only store 8 custom characters at a time, so the video is broken down into those 8 tile patterns. The rest of the screen is just a map telling the LCD which tile to draw where. Keeping the aspect ratio and adding black borders if needed ensures the whole video fits inside the screen area without cropping. The handshake protocol prevents data loss or crashes by syncing when the Arduino is ready to receive more data.
hiya! here we are with another bad apple video. i know some people have done this same thing before but they used the same code. this code i made myself. enjoy!