[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository has been archived by the owner on Sep 8, 2024. It is now read-only.
/ c3scooter Public archive

A ridiculously over the top "pimp-my-ride" for my 36c3 scooter.

License

Notifications You must be signed in to change notification settings

foosel/c3scooter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

41 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c3scooter

Project unmaintained

A ridiculously over the top "pimp-my-ride" for my 36c3 scooter.

Provided as-is for documentation purposes, not actively maintained.

Contents

  • assets - Images and such
  • src - MicroPython firmware, flash with e.g. mpfshell
  • stls - printables

Hardware

Firmware

  • Copy files over using mpfshell. Precompile everything but main.py to mpf.

Dev Environment

python3 -m virtualenv -p python3.6 venv
source venv/bin/activate
pip install -r requirements.txt
ln -s venv/lib/python3.6/site-packages/mpy_cross/mpy-cross venv/bin/mpy-cross

To compile jpg/png images to SSD1351 compatible raw, use img2rgb565.py:

# -*- coding: utf-8 -*-
"""Utility to convert images to raw RGB565 format."""

from PIL import Image
from struct import pack
from os import path
import sys


def error(msg):
    """Display error and exit."""
    print (msg)
    sys.exit(-1)


def write_bin(f, pixel_list):
    """Save image in RGB565 format."""
    for pix in pixel_list:
        r = (pix[0] >> 3) & 0x1F
        g = (pix[1] >> 2) & 0x3F
        b = (pix[2] >> 3) & 0x1F
        f.write(pack('>H', (r << 11) + (g << 5) + b))


if __name__ == '__main__':
    args = sys.argv
    if len(args) != 2:
        error('Please specify input file: ./img2rgb565.py test.png')
    in_path = args[1]
    if not path.exists(in_path):
        error('File Not Found: ' + in_path)

    filename, ext = path.splitext(in_path)
    out_path = filename + '.raw'
    img = Image.open(in_path).convert('RGB')
    pixels = list(img.getdata())
    with open(out_path, 'wb') as f:
        write_bin(f, pixels)
    print('Saved: ' + out_path)

(Licensed by @rdagger under MIT)

TODO / ideas

  • Another LED strip up the steering column?
  • RTC?
  • CSV data logging?
  • Sound & bass reactive (MSGEQ7)
  • 6-dof sensor & acceleration logging
  • electronic horn (mp3 board + speaker)

About

A ridiculously over the top "pimp-my-ride" for my 36c3 scooter.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published