-
Notifications
You must be signed in to change notification settings - Fork 11
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
1 parent
dca1f4d
commit ddffcb0
Showing
15 changed files
with
424 additions
and
424 deletions.
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,11 +1,11 @@ | ||
(module bird_with_pants_small (layer F.Cu) (tedit 5D6D8673) | ||
(fp_text reference G*** (at 0 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_text value LOGO (at 0.75 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_poly (pts (xy -1.143 -1.524) (xy 0.4445 -1.524) (xy 1.2192 0.5715) (xy -0.5334 0.5715) | ||
(xy -0.7874 -1.143)) (layer F.SilkS) (width 0.1)) | ||
(fp_poly (pts (xy -0.4953 0.8255) (xy 1.3208 0.8255) (xy 1.6002 1.5875) (xy -0.381 1.5875)) (layer F.SilkS) (width 0.1)) | ||
) | ||
(module bird_with_pants_small (layer F.Cu) (tedit 5D6D8673) | ||
(fp_text reference G*** (at 0 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_text value LOGO (at 0.75 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_poly (pts (xy -1.143 -1.524) (xy 0.4445 -1.524) (xy 1.2192 0.5715) (xy -0.5334 0.5715) | ||
(xy -0.7874 -1.143)) (layer F.SilkS) (width 0.1)) | ||
(fp_poly (pts (xy -0.4953 0.8255) (xy 1.3208 0.8255) (xy 1.6002 1.5875) (xy -0.381 1.5875)) (layer F.SilkS) (width 0.1)) | ||
) |
22 changes: 11 additions & 11 deletions
22
bigass_7_segment/lib_fp/bird_with_pants_small_flipped.kicad_mod
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,11 +1,11 @@ | ||
(module bird_with_pants_small_flipped (layer F.Cu) (tedit 5D6EE17B) | ||
(fp_text reference G*** (at 0 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_text value LOGO (at 0.75 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_poly (pts (xy 1.143 -1.524) (xy -0.4445 -1.524) (xy -1.2192 0.5715) (xy 0.5334 0.5715) | ||
(xy 0.7874 -1.143)) (layer F.SilkS) (width 0.1)) | ||
(fp_poly (pts (xy 0.4953 0.8255) (xy -1.3208 0.8255) (xy -1.6002 1.5875) (xy 0.381 1.5875)) (layer F.SilkS) (width 0.1)) | ||
) | ||
(module bird_with_pants_small_flipped (layer F.Cu) (tedit 5D6EE17B) | ||
(fp_text reference G*** (at 0 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_text value LOGO (at 0.75 0) (layer F.SilkS) hide | ||
(effects (font (size 1.524 1.524) (thickness 0.3))) | ||
) | ||
(fp_poly (pts (xy 1.143 -1.524) (xy -0.4445 -1.524) (xy -1.2192 0.5715) (xy 0.5334 0.5715) | ||
(xy 0.7874 -1.143)) (layer F.SilkS) (width 0.1)) | ||
(fp_poly (pts (xy 0.4953 0.8255) (xy -1.3208 0.8255) (xy -1.6002 1.5875) (xy 0.381 1.5875)) (layer F.SilkS) (width 0.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 |
---|---|---|
@@ -1,5 +1,5 @@ | ||
{ | ||
"programmer": "USBasp", | ||
"board": "arduino:avr:nano", | ||
"configuration": "cpu=atmega328" | ||
{ | ||
"programmer": "USBasp", | ||
"board": "arduino:avr:nano", | ||
"configuration": "cpu=atmega328" | ||
} |
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,23 +1,23 @@ | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Mac", | ||
"includePath": [ | ||
"/Applications/Arduino.app/Contents/Java/tools/**", | ||
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/**" | ||
], | ||
"forcedInclude": [ | ||
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h" | ||
], | ||
"macFrameworkPath": [ | ||
"/System/Library/Frameworks", | ||
"/Library/Frameworks" | ||
], | ||
"intelliSenseMode": "clang-x64", | ||
"compilerPath": "/usr/local/bin/gcc-9", | ||
"cStandard": "gnu18", | ||
"cppStandard": "gnu++14" | ||
} | ||
], | ||
"version": 4 | ||
{ | ||
"configurations": [ | ||
{ | ||
"name": "Mac", | ||
"includePath": [ | ||
"/Applications/Arduino.app/Contents/Java/tools/**", | ||
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/**" | ||
], | ||
"forcedInclude": [ | ||
"/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino/Arduino.h" | ||
], | ||
"macFrameworkPath": [ | ||
"/System/Library/Frameworks", | ||
"/Library/Frameworks" | ||
], | ||
"intelliSenseMode": "clang-x64", | ||
"compilerPath": "/usr/local/bin/gcc-9", | ||
"cStandard": "gnu18", | ||
"cppStandard": "gnu++14" | ||
} | ||
], | ||
"version": 4 | ||
} |
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,5 +1,5 @@ | ||
.pio | ||
.vscode/.browse.c_cpp.db* | ||
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch | ||
.pio | ||
.vscode/.browse.c_cpp.db* | ||
.vscode/c_cpp_properties.json | ||
.vscode/launch.json | ||
.vscode/ipch |
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,39 +1,39 @@ | ||
|
||
This directory is intended for project header files. | ||
|
||
A header file is a file containing C declarations and macro definitions | ||
to be shared between several project source files. You request the use of a | ||
header file in your project source file (C, C++, etc) located in `src` folder | ||
by including it, with the C preprocessing directive `#include'. | ||
|
||
```src/main.c | ||
|
||
#include "header.h" | ||
|
||
int main (void) | ||
{ | ||
... | ||
} | ||
``` | ||
|
||
Including a header file produces the same results as copying the header file | ||
into each source file that needs it. Such copying would be time-consuming | ||
and error-prone. With a header file, the related declarations appear | ||
in only one place. If they need to be changed, they can be changed in one | ||
place, and programs that include the header file will automatically use the | ||
new version when next recompiled. The header file eliminates the labor of | ||
finding and changing all the copies as well as the risk that a failure to | ||
find one copy will result in inconsistencies within a program. | ||
|
||
In C, the usual convention is to give header files names that end with `.h'. | ||
It is most portable to use only letters, digits, dashes, and underscores in | ||
header file names, and at most one dot. | ||
|
||
Read more about using header files in official GCC documentation: | ||
|
||
* Include Syntax | ||
* Include Operation | ||
* Once-Only Headers | ||
* Computed Includes | ||
|
||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html | ||
This directory is intended for project header files. | ||
A header file is a file containing C declarations and macro definitions | ||
to be shared between several project source files. You request the use of a | ||
header file in your project source file (C, C++, etc) located in `src` folder | ||
by including it, with the C preprocessing directive `#include'. | ||
```src/main.c | ||
#include "header.h" | ||
int main (void) | ||
{ | ||
... | ||
} | ||
``` | ||
Including a header file produces the same results as copying the header file | ||
into each source file that needs it. Such copying would be time-consuming | ||
and error-prone. With a header file, the related declarations appear | ||
in only one place. If they need to be changed, they can be changed in one | ||
place, and programs that include the header file will automatically use the | ||
new version when next recompiled. The header file eliminates the labor of | ||
finding and changing all the copies as well as the risk that a failure to | ||
find one copy will result in inconsistencies within a program. | ||
In C, the usual convention is to give header files names that end with `.h'. | ||
It is most portable to use only letters, digits, dashes, and underscores in | ||
header file names, and at most one dot. | ||
Read more about using header files in official GCC documentation: | ||
* Include Syntax | ||
* Include Operation | ||
* Once-Only Headers | ||
* Computed Includes | ||
https://gcc.gnu.org/onlinedocs/cpp/Header-Files.html |
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,22 +1,22 @@ | ||
#ifndef HB100_H | ||
#define HB100_H | ||
|
||
#include <Arduino.h> | ||
|
||
#define SPEED_BUF_SIZE 100 | ||
|
||
class HB100 { | ||
public: | ||
// sad sad, these are exposed because I need to hit them in an ISR | ||
volatile uint32_t last_pulse_period{0}; | ||
volatile uint32_t last_pulse_us{0}; | ||
|
||
HB100(){} | ||
|
||
uint16_t calc_speed(); | ||
private: | ||
uint16_t _speed_buf[SPEED_BUF_SIZE] = {0}; | ||
size_t _speed_buf_index = 0; | ||
}; | ||
|
||
#ifndef HB100_H | ||
#define HB100_H | ||
|
||
#include <Arduino.h> | ||
|
||
#define SPEED_BUF_SIZE 100 | ||
|
||
class HB100 { | ||
public: | ||
// sad sad, these are exposed because I need to hit them in an ISR | ||
volatile uint32_t last_pulse_period{0}; | ||
volatile uint32_t last_pulse_us{0}; | ||
|
||
HB100(){} | ||
|
||
uint16_t calc_speed(); | ||
private: | ||
uint16_t _speed_buf[SPEED_BUF_SIZE] = {0}; | ||
size_t _speed_buf_index = 0; | ||
}; | ||
|
||
#endif /* HB100_H */ |
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,53 +1,53 @@ | ||
#ifndef SEVEN_SEG_H | ||
#define SEVEN_SEG_H | ||
|
||
#include <Arduino.h> | ||
#include <SPI.h> | ||
|
||
#define SPI_RCLK_PIN_DEFAULT 10 | ||
#define SPI_RATE_HZ_DEFAULT 1400000 | ||
|
||
// Little Endian | ||
#define SEVEN_SEG_0 0b00111111 //11111100 | ||
#define SEVEN_SEG_1 0b00000110 //01100000 | ||
#define SEVEN_SEG_2 0b01011011 //11011010 | ||
#define SEVEN_SEG_3 0b01001111 //11110010 | ||
#define SEVEN_SEG_4 0b01100110 //01100110 | ||
#define SEVEN_SEG_5 0b01101101 //10110100 | ||
#define SEVEN_SEG_6 0b01111101 //10111110 | ||
#define SEVEN_SEG_7 0b00000111 //11100000 | ||
#define SEVEN_SEG_8 0b01111111 //11111110 | ||
#define SEVEN_SEG_9 0b01101111 //11110110 | ||
#define SEVEN_SEG_F 0b01110001 //10001100 | ||
#define SEVEN_SEG_BLANK 0x00 | ||
|
||
// Big Endian | ||
// #define SEVEN_SEG_0 0b11111100 | ||
// #define SEVEN_SEG_1 0b01100000 | ||
// #define SEVEN_SEG_2 0b11011010 | ||
// #define SEVEN_SEG_3 0b11110010 | ||
// #define SEVEN_SEG_4 0b01100110 | ||
// #define SEVEN_SEG_5 0b10110100 | ||
// #define SEVEN_SEG_6 0b10111110 | ||
// #define SEVEN_SEG_7 0b11100000 | ||
// #define SEVEN_SEG_8 0b11111110 | ||
// #define SEVEN_SEG_9 0b11110110 | ||
// #define SEVEN_SEG_F 0b10001100 | ||
|
||
class SevenSeg { | ||
public: | ||
SevenSeg(uint8_t spi_rclk_pin = SPI_RCLK_PIN_DEFAULT, uint32_t spi_rate_hz = SPI_RATE_HZ_DEFAULT) | ||
: _spi_rclk_pin(spi_rclk_pin) | ||
, _spi_rate_hz(spi_rate_hz) {} | ||
void init(); | ||
void write(uint8_t value, bool decimal=false); | ||
|
||
private: | ||
uint8_t _spi_rclk_pin; | ||
uint32_t _spi_rate_hz; | ||
|
||
uint8_t digit_to_seg(uint8_t digit, bool decimal=false); | ||
|
||
}; | ||
|
||
#ifndef SEVEN_SEG_H | ||
#define SEVEN_SEG_H | ||
|
||
#include <Arduino.h> | ||
#include <SPI.h> | ||
|
||
#define SPI_RCLK_PIN_DEFAULT 10 | ||
#define SPI_RATE_HZ_DEFAULT 1400000 | ||
|
||
// Little Endian | ||
#define SEVEN_SEG_0 0b00111111 //11111100 | ||
#define SEVEN_SEG_1 0b00000110 //01100000 | ||
#define SEVEN_SEG_2 0b01011011 //11011010 | ||
#define SEVEN_SEG_3 0b01001111 //11110010 | ||
#define SEVEN_SEG_4 0b01100110 //01100110 | ||
#define SEVEN_SEG_5 0b01101101 //10110100 | ||
#define SEVEN_SEG_6 0b01111101 //10111110 | ||
#define SEVEN_SEG_7 0b00000111 //11100000 | ||
#define SEVEN_SEG_8 0b01111111 //11111110 | ||
#define SEVEN_SEG_9 0b01101111 //11110110 | ||
#define SEVEN_SEG_F 0b01110001 //10001100 | ||
#define SEVEN_SEG_BLANK 0x00 | ||
|
||
// Big Endian | ||
// #define SEVEN_SEG_0 0b11111100 | ||
// #define SEVEN_SEG_1 0b01100000 | ||
// #define SEVEN_SEG_2 0b11011010 | ||
// #define SEVEN_SEG_3 0b11110010 | ||
// #define SEVEN_SEG_4 0b01100110 | ||
// #define SEVEN_SEG_5 0b10110100 | ||
// #define SEVEN_SEG_6 0b10111110 | ||
// #define SEVEN_SEG_7 0b11100000 | ||
// #define SEVEN_SEG_8 0b11111110 | ||
// #define SEVEN_SEG_9 0b11110110 | ||
// #define SEVEN_SEG_F 0b10001100 | ||
|
||
class SevenSeg { | ||
public: | ||
SevenSeg(uint8_t spi_rclk_pin = SPI_RCLK_PIN_DEFAULT, uint32_t spi_rate_hz = SPI_RATE_HZ_DEFAULT) | ||
: _spi_rclk_pin(spi_rclk_pin) | ||
, _spi_rate_hz(spi_rate_hz) {} | ||
void init(); | ||
void write(uint8_t value, bool decimal=false); | ||
|
||
private: | ||
uint8_t _spi_rclk_pin; | ||
uint32_t _spi_rate_hz; | ||
|
||
uint8_t digit_to_seg(uint8_t digit, bool decimal=false); | ||
|
||
}; | ||
|
||
#endif /* SEVEN_SEG_H */ |
Oops, something went wrong.