Skip to content

Commit

Permalink
Merge pull request #11 from cepdnaclk/feature/firmware/main-controller
Browse files Browse the repository at this point in the history
Feature/firmware/main controller
  • Loading branch information
akashwi authored Jan 7, 2024
2 parents eaadb27 + 402347e commit b3884ff
Show file tree
Hide file tree
Showing 7 changed files with 427 additions and 0 deletions.
18 changes: 18 additions & 0 deletions code/Firmware/Main Controller/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# PlatformIO folders and files
.pio/
lib/
.pioenvs/
.vscode/
*.iml

# Compiled files
*.bin
*.elf

# System and IDE files
.DS_Store
.settings/
*.sublime-workspace
*.sublime-project
/.idea/
/.vs/
56 changes: 56 additions & 0 deletions code/Firmware/Main Controller/diagram.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
{
"version": 1,
"author": "Akash Withanaarachchi",
"editor": "wokwi",
"parts": [
{
"type": "board-esp32-devkit-c-v4",
"id": "esp",
"top": 67.2,
"left": -158.36,
"attrs": {}
},
{
"type": "wokwi-ili9341",
"id": "lcd1",
"top": -344.8,
"left": -192.3,
"attrs": {}
},
{
"type": "wokwi-hx711",
"id": "cell1",
"top": 185,
"left": 50.6,
"attrs": { "type": "5kg" }
}
],
"connections": [
["esp:TX", "$serialMonitor:RX", "", []],
["esp:RX", "$serialMonitor:TX", "", []],
["esp:5V", "lcd1:VCC", "red", ["h-86.25", "v-240", "h96"]],
["esp:15", "lcd1:CS", "green", ["v0", "h28.8", "v-220.8", "h-96"]],
["esp:4", "lcd1:RST", "green", ["h38.4", "v-201.6", "h-96"]],
["esp:2", "lcd1:D/C", "green", ["h48", "v-230.4", "h-96"]],
["lcd1:GND", "esp:GND.2", "black", ["v115.2", "h96", "v57.6"]],
["esp:23", "lcd1:MOSI", "green", ["h57.6", "v-115.2", "h-96"]],
["esp:18", "lcd1:SCK", "green", ["h67.2", "v-192", "h-96"]],
["esp:19", "lcd1:MISO", "green", ["h86.4", "v-192", "h-96"]],
["lcd1:LED", "lcd1:VCC", "red", ["v28.8", "h-67.21"]],
["esp:GND.2", "cell1:GND", "black", ["v0", "h96", "v115.2"]],
["esp:5V", "cell1:VCC", "red", ["h0.15", "v19.2", "h192", "v-48"]],
[
"esp:13",
"cell1:SCK",
"orange",
["h-28.65", "v67.2", "h211.2", "v-67.2"]
],
[
"esp:14",
"cell1:DT",
"orange",
["h-38.25", "v105.6", "h211.2", "v-86.4"]
]
],
"dependencies": {}
}
39 changes: 39 additions & 0 deletions code/Firmware/Main Controller/include/README
Original file line number Diff line number Diff line change
@@ -0,0 +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
20 changes: 20 additions & 0 deletions code/Firmware/Main Controller/platformio.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html

[env:nodemcu-32s]
platform = espressif32
board = nodemcu-32s
framework = arduino
monitor_speed = 115200
lib_deps =
bogde/HX711@^0.7.5
bodmer/TFT_eSPI@^2.5.43
knolleary/PubSubClient@^2.8
bblanchon/ArduinoJson@^6.21.4
Loading

0 comments on commit b3884ff

Please sign in to comment.