Giter Club home page Giter Club logo

badspike's Introduction

Bad Apple on LEGO Spike Prime

This is a port of Bad Apple running on LEGO Spike Prime (45678) and Mindstorms Inventor (51515) (not tested) on stock legacy firmware (1.3.0.0 / 4.0.0.7).

Check out the video Here

How it works

The program reads the frames and audio data from the filesystem.
The audio data is raw unsigned 16-bit PCM truncated to 12-bit at 16kHz sample rate, and the video data is a byte stream where each byte is a value in range [0,9] that represents each pixel. The brick reads the video data 25 bytes at a time and displays it.

The program is written in python using the reverse-enginered scratch api which you can check out Here.

Copying the data

In order for the program to actually run, it needs to have the data copied to the brick's flash memory. Luckily, the flash is almost unused, as we have 31 out of 32 megabytes free.

To copy the data, use the cp.py script inside the data folder, copied from sanjayseshan's spikeprime-tools repository, to copy over the audio and frames files into the root / folder on the brick's filesystem.

  • ./cp.py "frames" - to copy the video frames
  • ./cp.py "audio" - to copy the audio

Note: the brick will probably reboot after each copy.

The brick seems to check its file system on every boot, so the boot time will increase after this.

Running the program

In order to get the program on the brick, using the Spike APP won't work properly. Use the following process:

badspike's People

Contributors

mive82 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.