Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New library #1

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
71 changes: 71 additions & 0 deletions .github/workflows/firmware_workflow.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Firmware

on:
push:
branches:
- "main"
tags:
- "*"
pull_request:
paths:
- "Firmware/**"
- ".github/workflows/**"

#
jobs:
make_firmware:
runs-on: ubuntu-latest
name: Firmware Builder

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Test Library
run: cd Firmware/examples/count && pio run

delint:
runs-on: ubuntu-latest
name: Delinter

steps:
- uses: actions/checkout@v2
- name: Cache pip
uses: actions/cache@v2
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Cache PlatformIO
uses: actions/cache@v2
with:
path: ~/.platformio
key: ${{ runner.os }}-${{ hashFiles('**/lockfiles') }}
- name: Set up Python
uses: actions/setup-python@v2
- name: Install PlatformIO
run: |
python -m pip install --upgrade pip
pip install --upgrade platformio

- name: Run Delinter
run: cd Firmware/examples/count && pio check
#
48 changes: 22 additions & 26 deletions .github/workflows/hardware_workflow.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
name: Hardware Workflow
name: Hardware

permissions:
contents: write
actions: read
checks: write

on:
push:
Expand All @@ -9,17 +14,16 @@ on:
pull_request:
paths:
- "Hardware/**"
- "Docs/**"

permissions: write-all
- ".github/workflows/**"

#
jobs:
KiCad_Hardware:
runs-on: ubuntu-latest
name: KiCad Hardware

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
fetch-depth: 0
submodules: true
Expand All @@ -32,41 +36,35 @@ jobs:
dir: _hardwareOutput

# Hardware Files
schema: "Hardware/SegmentTestBoard/SegmentTestBoard.kicad_sch"
board: "Hardware/SegmentTestBoard/SegmentTestBoard.kicad_pcb"
#
schema: "Hardware/ShiftSegmentBoard/ShiftSegmentBoard.kicad_sch"
board: "Hardware/ShiftSegmentBoard/ShiftSegmentBoard.kicad_pcb"
#

- name: upload results
uses: actions/upload-artifact@v2
with:
name: Board-Hardware
path: _hardwareOutput

- name: Discord notification if failed
if: ${{ failure() }}
uses: appleboy/discord-action@master
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
args: "Building new board failed, most likely a DRC check."

dev-publish:
# publish only to devs
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
name: Dev-Publish
needs: [KiCad_Hardware]

steps:
# Download artifacts
- uses: actions/download-artifact@v2
with:
name: Board-Hardware

- name: send custom message with args
uses: appleboy/discord-action@master
- name: Upload KiCAD Artifacts
uses: edunad/[email protected]
with:
webhook_id: ${{ secrets.WEBHOOK_ID }}
webhook_token: ${{ secrets.WEBHOOK_TOKEN }}
file: "SegmentTestBoard-3D_top.png"
path: "*-3D_top.png"
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
title: "PCB"

publish:
# Only run on tags
Expand All @@ -77,32 +75,30 @@ jobs:

steps:
# Be in our repo
- uses: actions/checkout@v3
- uses: actions/checkout@v2
with:
fetch-depth: 0

# Download artifacts
- uses: actions/download-artifact@v2
with:
name: Board-Hardware

- run: mkdir -p _staging/

- run: cp *.pdf _staging/

- run: cp *.step _staging/

# Copy gerbers
- run: cp PCBWay/*.zip _staging/Board-$(git rev-parse --short HEAD)-PCBWay.zip
- run: cp JLCPCB/*.zip _staging/Board-$(git rev-parse --short HEAD)-JLCPCB.zip

- name: Upload Docs to release
- name: Upload artifacts to release
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: "_staging/*"
tag: ${{ github.ref }}
overwrite: true
prerelease: true
#
body: "Kitsune Scientific, Automated with github ci/cd."
file_glob: true
20 changes: 3 additions & 17 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,16 @@ _build

# CAD Artifacts
*.stl
*.blend1
OldVersions

# Doc artifacts
_*/
~$*

# Temporary files
*.000
*.bak
*.bck
*.kicad_*-bak
*.kicad_pcb-bak
*.kicad_sch-bak
*-backups
*.kicad_prl
*.sch-bak
Expand All @@ -33,6 +31,7 @@ _autosave-*
*-save.kicad_pcb
fp-info-cache
*auto_saved_files#
*.lck

# Netlist files (exported from Eeschema)
*.net
Expand All @@ -50,16 +49,3 @@ fp-info-cache

# dev artifacts
.vscode

# Docs
*.gz
*.aux
*.log
*.out
*.snm
*.toc
*.nav
*.dvi
*.idx
*.ilg
*.ind
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[submodule "Hardware/SegmentTestBoard/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/SegmentTestBoard/Libraries/kenwoodfox-kicad-libraries
[submodule "Hardware/ShiftSegmentBoard/Libraries/kenwoodfox-kicad-libraries"]
path = Hardware/ShiftSegmentBoard/Libraries/kenwoodfox-kicad-libraries
url = https://github.com/KenwoodFox/kenwoodfox-kicad-libraries.git
Binary file added CAD/Cube.FCStd
Binary file not shown.
5 changes: 5 additions & 0 deletions Firmware/examples/count/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.pio
.vscode/.browse.c_cpp.db*
.vscode/c_cpp_properties.json
.vscode/launch.json
.vscode/ipch
14 changes: 14 additions & 0 deletions Firmware/examples/count/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
; PlatformIO Project Configuration File

[env:megaatmega2560]
platform = atmelavr
board = megaatmega2560
framework = arduino

lib_deps = ; External libraries
../../

# Monitor Settings
monitor_speed = 115200
monitor_rts = 0
monitor_dtr = 0
50 changes: 50 additions & 0 deletions Firmware/examples/count/src/main.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
/**
* @file main.cpp
* @author Joe
* @brief Source code for ShiftSegmentBoard
*/

// Libs
#include <Arduino.h>

// Display
#include <shiftDisplay.h>

// Objects
const uint8_t DIN_PIN = 7;
const uint8_t CLK_PIN = 9;
const uint8_t LAT_PIN = 8;
shiftDisplay disp = shiftDisplay(DIN_PIN, CLK_PIN, LAT_PIN);

void setup()
{
// Setup serial
delay(200);
Serial.begin(115200);

// Setup disp
disp.begin();

// Pins
pinMode(LED_BUILTIN, OUTPUT);
}

uint8_t i = 0;

void loop()
{
// Flash LED
digitalWrite(LED_BUILTIN, HIGH);
delay(100);
digitalWrite(LED_BUILTIN, LOW);
delay(100);

disp.setDigit(i);
disp.setDecimal(i % 2 == 0);
Serial.println(i);
i++;
if (i >= 37)
{
i = 0;
}
}
7 changes: 7 additions & 0 deletions Firmware/include/boardPins.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#ifndef _BOARD_PINS_H
#define _BOARD_PINS_H

// LEDs
#define STAT_LED 13

#endif
22 changes: 22 additions & 0 deletions Firmware/library.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "shiftDisplay",
"version": "1.0.0",
"description": "A super simple library to interface specifically with my shift boards.",
"keywords": "kitsunescientific, shift segment",
"repository": {
"type": "git",
"url": "https://github.com/Kitsune-Robotics/SegmentTestBoard.git"
},
"authors": [
{
"name": "Joe",
"email": "[email protected]",
"maintainer": true
}
],
"license": "BSD",
"homepage": "https://www.helloworld.org/",
"dependencies": {},
"frameworks": "*",
"platforms": "*"
}
34 changes: 34 additions & 0 deletions Firmware/src/letters.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
/**
* @brief Letter shortcuts
*
*/
enum Letters
{
l_BLANK = 10,
l_A = 11,
l_B = 12,
l_C = 13,
l_D = 14,
l_E = 15,
l_F = 16,
l_G = 17,
l_H = 18,
l_I = 19,
l_J = 20,
l_K = 21,
l_L = 22,
l_M = 23,
l_N = 24,
l_O = 25,
l_P = 26,
l_Q = 27,
l_R = 28,
l_S = 29,
l_T = 30,
l_U = 31,
l_V = 32,
l_W = 33,
l_X = 34,
l_Y = 35,
l_Z = 36,
};
Loading