-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,024 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,50 @@ | ||
# PixelTime | ||
|
||
<p align="center"> | ||
<br> | ||
<img src="https://avatars.githubusercontent.com/u/117961102" width="150"/> | ||
<br> | ||
</p> | ||
<p align="center"> | ||
<img alt="GitHub release (latest by date)" src="https://img.shields.io/github/v/release/MakerM0/PixelTime"> | ||
<img alt="GitHub top language" src="https://img.shields.io/github/languages/top/MakerM0/PixelTime"> | ||
</p> | ||
|
||
|
||
# [PixelTime](https://oshwhub.com/kakaka/PixelTime) | ||
a low power led watch based on ESP32 C3 | ||
|
||
![5](documents/images/5.png) | ||
|
||
![7](documents/images/7.jpg) | ||
|
||
![4](documents/images/4.jpg) | ||
|
||
![2](documents/images/2.jpg) | ||
|
||
![3](documents/images/3.jpg) | ||
|
||
![6](documents/images/6.jpg) | ||
|
||
![1](documents/images/1.png) | ||
|
||
## Software | ||
|
||
based on MicroPython | ||
|
||
|
||
|
||
|
||
|
||
## Mechanical | ||
|
||
|
||
|
||
## License | ||
|
||
(hardware/mechanical)[Creative Commons — Attribution-NonCommercial-ShareAlike 4.0 International — CC BY-NC-SA 4.0](https://creativecommons.org/licenses/by-nc-sa/4.0/) | ||
|
||
|
||
|
||
## Extra | ||
|
||
|
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# MicroPython basic bitmap font renderer. | ||
# Author: Tony DiCola | ||
# License: MIT License (https://opensource.org/licenses/MIT) | ||
try: | ||
import ustruct | ||
except ImportError: | ||
import struct as ustruct | ||
|
||
|
||
class BitmapFont: | ||
|
||
def __init__(self, width, height, pixel, font_name='font5x8.bin'): | ||
# Specify the drawing area width and height, and the pixel function to | ||
# call when drawing pixels (should take an x and y param at least). | ||
# Optionally specify font_name to override the font file to use (default | ||
# is font5x8.bin). The font format is a binary file with the following | ||
# format: | ||
# - 1 unsigned byte: font character width in pixels | ||
# - 1 unsigned byte: font character height in pixels | ||
# - x bytes: font data, in ASCII order covering all 255 characters. | ||
# Each character should have a byte for each pixel column of | ||
# data (i.e. a 5x8 font has 5 bytes per character). | ||
self._width = width | ||
self._height = height | ||
self._pixel = pixel | ||
self._font_name = font_name | ||
|
||
def init(self): | ||
# Open the font file and grab the character width and height values. | ||
# Note that only fonts up to 8 pixels tall are currently supported. | ||
self._font = open(self._font_name, 'rb') | ||
self._font_width, self._font_height = ustruct.unpack('BB', self._font.read(2)) | ||
|
||
def deinit(self): | ||
# Close the font file as cleanup. | ||
self._font.close() | ||
|
||
def __enter__(self): | ||
self.init() | ||
return self | ||
|
||
def __exit__(self, exception_type, exception_value, traceback): | ||
self.deinit() | ||
|
||
def draw_char(self, ch, x, y, *args, **kwargs): | ||
# Don't draw the character if it will be clipped off the visible area. | ||
if x < -self._font_width or x >= self._width or \ | ||
y < -self._font_height or y >= self._height: | ||
return | ||
# Go through each column of the character. | ||
for char_x in range(self._font_width): | ||
# Grab the byte for the current column of font data. | ||
self._font.seek(2 + (ord(ch) * self._font_width) + char_x) | ||
line = ustruct.unpack('B', self._font.read(1))[0] | ||
# Go through each row in the column byte. | ||
for char_y in range(self._font_height): | ||
# Draw a pixel for each bit that's flipped on. | ||
if (line >> char_y) & 0x1: | ||
self._pixel(x + char_x, y + char_y, *args, **kwargs) | ||
|
||
def text(self, text, x, y, *args, **kwargs): | ||
# Draw the specified text at the specified location. | ||
for i in range(len(text)): | ||
self.draw_char(text[i], x + (i * (self._font_width + 1)), y, | ||
*args, **kwargs) | ||
|
||
def width(self, text): | ||
# Return the pixel width of the specified text message. | ||
return len(text) * (self._font_width + 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# This file is executed on every boot (including wake-boot from deepsleep) | ||
#import esp | ||
#esp.osdebug(None) | ||
#import webrepl | ||
#webrepl.start() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
|
||
|
||
|
||
#wifi | ||
ssid = " " | ||
password = " " |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
FONT3X8 = ( | ||
# | ||
# NUM0 = | ||
( | ||
1, 1, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM1 = | ||
( | ||
0, 1, 0, | ||
1, 1, 0, | ||
0, 1, 0, | ||
0, 1, 0, | ||
0, 1, 0, | ||
0, 1, 0, | ||
0, 1, 0, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM2 = | ||
( | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
1, 1, 1, | ||
1, 0, 0, | ||
1, 0, 0, | ||
1, 0, 0, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM3 = | ||
( | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM4 = | ||
( | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
), | ||
# | ||
# NUM5 = | ||
( | ||
1, 1, 1, | ||
1, 0, 0, | ||
1, 0, 0, | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM6 = | ||
( | ||
1, 1, 1, | ||
1, 0, 0, | ||
1, 0, 0, | ||
1, 1, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM7 = | ||
( | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
), | ||
# | ||
# NUM8 = | ||
( | ||
1, 1, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
), | ||
# | ||
# NUM9 = | ||
( | ||
1, 1, 1, | ||
1, 0, 1, | ||
1, 0, 1, | ||
1, 1, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
0, 0, 1, | ||
1, 1, 1, | ||
) | ||
) |
Binary file not shown.
Oops, something went wrong.