Browse Source

uploaded first functional beta

master
studentidisinistra 2 years ago
parent
commit
149af8e772
8 changed files with 0 additions and 163 deletions
  1. BIN
      Pinouts/D1-mini-pinout.png
  2. BIN
      Pinouts/LCD and buttons interface.jpg
  3. BIN
      Pinouts/Machine Pinout.jpg
  4. +0
    -31
      Pinouts/config.coffee
  5. BIN
      Pinouts/lcd_pinout.jpg
  6. BIN
      Pinouts/pinoutLCD.png
  7. +0
    -109
      PyCoffeeESP8266/PyCoffeeESP8266.ino
  8. +0
    -23
      PyCoffeeNano/PyCoffeeNano.ino

BIN
Pinouts/D1-mini-pinout.png View File

Before After
Width: 1288  |  Height: 851  |  Size: 617 KiB

BIN
Pinouts/LCD and buttons interface.jpg View File

Before After
Width: 3342  |  Height: 2096  |  Size: 684 KiB

BIN
Pinouts/Machine Pinout.jpg View File

Before After
Width: 2455  |  Height: 2054  |  Size: 947 KiB

+ 0
- 31
Pinouts/config.coffee View File

@ -1,31 +0,0 @@
generalConfig =
serialDevice: '/dev/coffee'
logFilename: 'coffee.log'
tempTimeout: 50
pumpCoefficient: 1.35
hardwareConfig =
coffeeTemp: 0.758
coffeeTemp2: 0.758 + 0.1
grinderPin: 9
pumpPin: 8
boilerPin: 6
powderPin: 7
wheelPin: 10
invertWheelPin: 11
powderSensorPin: 2
vaporSensorPin: 5
tempSensorPin: 7
wheelStartSensorPin: 4
wheelEndSensorPin: 3
accountingConfig =
coffeePrice: 20
exports.general = generalConfig
exports.hardware = hardwareConfig
exports.accounting = accountingConfig

BIN
Pinouts/lcd_pinout.jpg View File

Before After
Width: 630  |  Height: 555  |  Size: 29 KiB

BIN
Pinouts/pinoutLCD.png View File

Before After
Width: 1587  |  Height: 1032  |  Size: 98 KiB

+ 0
- 109
PyCoffeeESP8266/PyCoffeeESP8266.ino View File

@ -1,109 +0,0 @@
#include <Arduino.h>
#include <ESP8266WiFi.h>
#include <ESPAsyncTCP.h>
#include <ESPAsyncWebServer.h>
#include <AsyncElegantOTA.h>
#include <Wire.h>
#include <LiquidCrystal.h>
AsyncWebServer server(80);
// WiFi settings
const char* ssid = "LILiK_WiFi"; //replace with your SSID
const char* password = "pippopippo"; //password
String hostname = "PyCoffee";
// HTML WEB interface
const char index_html[] PROGMEM = R"rawliteral(
<!DOCTYPE HTML><html><head>
<title>PyCoffee HTML interface</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
</head><body>
<h2>Ciao! Sono l'ESP8266 che gestisce la PyCoffee!</h2>
<style>
html {font-family: Times New Roman; display: inline-block; text-align: center;}
h2 {font-size: 2.0rem;}
h3 {font-size: 2.0rem; color: #FF0000;}
</style>
<h2>Clicca qui sotto per aggiornare il firmware, o il secondo link per il sorgente.</h2>
<a href='/update'>&#11014;&#65039; OTA Firmware_Update &#11014;&#65039;</a>
<a href='https://projects.lilik.it/LILiK/PyCoffee_ESP8266'>&#9749;Gitea&#9749;</a><br><br>
</body></html>)rawliteral";
// LCD pins <--> ESP8266 LOLIN D1 pins
const int e_RS = 4, e_EN = 5, e_D4 = 12, e_D5 = 13, e_D6 = 14, e_D7 = 15;
LiquidCrystal lcd(e_RS, e_EN, e_D4, e_D5, e_D6, e_D7);
// Custom character matrix (coffee cup left side)
byte cupL[8] = {0b00001,0b00010,0b00010,0b00001,0b00001,0b00000,0b00111,0b00100};
// Custom character matrix (coffee cup center)
byte cupC[8] = {0b00100,0b00101,0b01001,0b01000,0b00100,0b00000,0b11111,0b00000};
// Custom character matrix (coffee cup right side)
byte cupR[8] = {0b10000,0b00000,0b00000,0b10000,0b10000,0b00000,0b11000,0b01110};
// Custom character matrix (coffee cup left side line 2)
byte cupL1[8] = {0b00100,0b00100,0b00100,0b00010,0b01111,0b01000,0b00111,0b00000};
// Custom character matrix (coffee cup center line 2)
byte cupC1[8] = {0b00000,0b00000,0b00000,0b00000,0b11111,0b00000,0b11111,0b00000};
// Custom character matrix (coffee cup right side line 2)
byte cupR1[8] = {0b01010,0b01010,0b01110,0b10000,0b11100,0b00100,0b11000,0b00000};
void notFound(AsyncWebServerRequest *request) {
request->send(404, "text/plain", "Not found");
}
// the setup function runs once when you press reset or power the board
void setup(void) {
// initialize serial:
Serial.begin(9600);
// Make custom characters available to LCD
lcd.createChar(0, cupL);
lcd.createChar(1, cupC);
lcd.createChar(2, cupR);
lcd.createChar(3, cupL1);
lcd.createChar(4, cupC1);
lcd.createChar(5, cupR1);
lcd.begin(16, 2); // set up number of columns and rows
lcd.clear(); // Clear LCD
// this part is for testing and boot messages only
lcd.setCursor(0, 0); // move cursor to (0, 0)
lcd.print("PyCoffee_WiFi");
WiFi.mode(WIFI_STA);
// WiFi.config(INADDR_NONE, INADDR_NONE, INADDR_NONE, INADDR_NONE);
WiFi.setHostname(hostname.c_str()); //define hostname
WiFi.begin(ssid, password);
// Send web page with input fields to client
server.on("/", HTTP_GET, [](AsyncWebServerRequest * request) {
request->send(200, "text/html", index_html);
});
server.onNotFound(notFound);
AsyncElegantOTA.begin(&server); // Start ElegantOTA
server.begin();
Serial.println("HTTP server started");
}
// the loop function runs over and over again forever
void loop() {
delay(1000);
lcd.clear(); // Clear LCD at every cycle
lcd.setCursor(0, 0); // move cursor to (0, 0)
lcd.print("Test");
lcd.setCursor(0, 1); // move cursor to (0, 0)
lcd.print("V ALPHA 0.1");
delay(1000);
lcd.setCursor(12,0); //print using uint8 method
lcd.write((uint8_t)0);
lcd.write((uint8_t)1);
lcd.write((uint8_t)2);
lcd.setCursor(12,1); //print using uint8 method
lcd.write((uint8_t)3);
lcd.write((uint8_t)4);
lcd.write((uint8_t)5);
}

+ 0
- 23
PyCoffeeNano/PyCoffeeNano.ino View File

@ -1,23 +0,0 @@
// Pinout configuration
const int grinderPin = 9, pumpPin = 8, boilerPin = 6, powderPin = 7, wheelPin = 10, invertWheelPin = 11, powderSensorPin = 2, vaporSensorPin = 5, tempSensorPin = 7, wheelStartSensorPin = 4, wheelEndSensorPin = 3, redLED = 13, greenLED = 12;
// Milliseconds to delay between each cycle
# define milliseconds 10;
int timeratio = 1;
void setup() {
// put your setup code here, to run once:
// first we set pins as I/O and initialize outputs LOW
pinMode ((grinderPin, pumpPin, boilerPin, powderPin, wheelPin, invertWheelPin, redLED, greenLED), OUTPUT);
pinMode ((powderSensorPin, vaporSensorPin, tempSensorPin, wheelStartSensorPin, wheelEndSensorPin), INPUT);
digitalWrite((grinderPin, pumpPin, boilerPin, powderPin, wheelPin, invertWheelPin, redLED, greenLED), LOW);
// timeratio easily allows to determine how many cycles are required to make 1s pass (ms * ratio = 1s)
timeratio = 1000/milliseconds;
// initialize serial:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
}

Loading…
Cancel
Save