diff --git a/Scroll_Pi_Text.py b/Scroll_Pi_Text.py new file mode 100644 index 0000000..20afd13 --- /dev/null +++ b/Scroll_Pi_Text.py @@ -0,0 +1,3588 @@ +#Created By: Justin Healy and Vin Presciutti || 2021 +#Based off of work done by 2020 Melissa LeBlanc-Williams, written for Adafruit Industries, MIT +#!/usr/bin/python3 + +import board +import neopixel +from PIL import Image +from adafruit_pixel_framebuf import PixelFramebuffer +import time +import argparse + + +gpio_pin = board.D18 + +pixel_width = 8 +scroll_width = pixel_width + 1 +pixel_height = 16 +scroll_height = pixel_height + 1 + +pixel_max = pixel_width * pixel_height - 1 + +led_message = "Jakiiswonderful" + +# Main program logic follows: +if __name__ == '__main__': + # Process arguments + parser = argparse.ArgumentParser() + parser.add_argument('-c', '--clear', action='store_true', help='clear the display on exit') + args = parser.parse_args() + + # Create NeoPixel object with appropriate configuration. + neo_pixel = neopixel.NeoPixel(gpio_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False) + #Create PixelFramebuffer object with appropriate configuration. + pixel_framebuf = PixelFramebuffer(neo_pixel, pixel_width, pixel_height, reverse_x=True,alternating=True) + + print ('Press Ctrl-C to quit.') + if not args.clear: + print('Use "-c" argument to clear LEDs on exit') + + try: + + while True: + led_message_len = len(led_message) + led_message_scroll_height = led_message_len * 16 + for led_scroll in range(0, led_message_scroll_height , 1): + led_char_counter = 1 + pixel_framebuf.fill(0x000000) + + for led_char in led_message: + + led_char_spacing = 8 * led_char_counter + led_char_pos = pixel_height - led_scroll + led_char_spacing + pixel_framebuf.text(led_char, 0, led_char_pos , 0x00FF00) + pixel_framebuf.display() + time.sleep(50/500) + led_char_counter += 1 + + + except KeyboardInterrupt: + if args.clear: + neo_pixel.deinit() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +#Created By: Justin Healy and Vin Presciutti || 2021 +#Based off of work done by 2020 Melissa LeBlanc-Williams, written for Adafruit Industries, MIT +#!/usr/bin/python3 + +import board +import neopixel +from PIL import Image +from adafruit_pixel_framebuf import PixelFramebuffer +import time +from rpi_ws281x import * +import argparse + + +gpio_pin = board.D18 + +pixel_width = 8 +scroll_width = pixel_width + 1 +pixel_height = 16 +scroll_height = pixel_height + 1 + +pixel_max = pixel_width * pixel_height - 1 + +led_message = "Yo" + + + + + +# Main program logic follows: +if __name__ == '__main__': + # Process arguments + parser = argparse.ArgumentParser() + parser.add_argument('-c', '--clear', action='store_true', help='clear the display on exit') + args = parser.parse_args() + + # Create NeoPixel object with appropriate configuration. + neo_pixel = neopixel.NeoPixel(gpio_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False) + #Create PixelFramebuffer object with appropriate configuration. + pixel_framebuf = PixelFramebuffer(neo_pixel, pixel_width, pixel_height, reverse_x=True,alternating=True) + + print ('Press Ctrl-C to quit.') + if not args.clear: + print('Use "-c" argument to clear LEDs on exit') + + try: + + while True: + led_message_len = len(led_message) + led_message_scroll_height = led_message_len * 16 + for led_scroll in range(0, led_message_scroll_height , 1): + led_char_counter = 1 + pixel_framebuf.fill(0x000000) + + for led_char in led_message: + + led_char_spacing = 8 * int(led_char_counter) + led_char_pos = pixel_height - led_scroll + int(led_char_spacing) + print("Character: " + str(led_char) + " and Position: "+ str(led_char_pos) + " and Spacing: " + str(led_char_spacing)) + pixel_framebuf.text(led_char, 0, led_char_pos , 0x00FF00) + pixel_framebuf.display() + time.sleep(50/500.0) + led_char_counter += 1 + + + except KeyboardInterrupt: + if args.clear: + neo_pixel.deinit() + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Scroll_Pi_Text.py.save b/Scroll_Pi_Text.py.save new file mode 100644 index 0000000..c24f92c --- /dev/null +++ b/Scroll_Pi_Text.py.save @@ -0,0 +1,29 @@ +#!/usr/bin/python3 +""" +Be sure to check the learn guides for more usage information. + +This example is for use on (Linux) computers that are using CPython with +Adafruit Blinka to support CircuitPython libraries. CircuitPython does +not support PIL/pillow (python imaging library)! + +Author(s): Melissa LeBlanc-Williams for Adafruit Industries +""" +import board +import neopixel +from PIL import Image +from adafruit_pixel_framebuf import PixelFramebuffer + +pixel_pin = board.D18 +pixel_width = 8 +pixel_height = 16 + +pixels = neopixel.NeoPixel( + pixel_pin, pixel_width * pixel_height, brightness=0.1, auto_write=False, +) +pixel_framebuf = PixelFramebuffer(pixels, pixel_width, pixel_height, reverse_x=True,alternating=True) +pixel_framebuf.fill(0x000000) +pixel_framebuf.display() +pixel_framebuf.text("H", 0, 0, 0x00FF00) +pixel_framebuf.display() +pixel_framebuf.text("i", 0, 8, 0x00FF00) +pixel_framebuf.display() diff --git a/framebuf-test.py b/framebuf-test.py index 61cc019..015998d 100644 --- a/framebuf-test.py +++ b/framebuf-test.py @@ -32,5 +32,3 @@ pixel_framebuf.display() - - diff --git a/supporting_files/message_file b/supporting_files/message_file new file mode 100644 index 0000000..e69de29