Fügt Controller hinzu
Signed-off-by: Christof Seyfferth <mail@seyfferth.dev>
This commit is contained in:
1
.theia/settings.json
Normal file
1
.theia/settings.json
Normal file
@@ -0,0 +1 @@
|
|||||||
|
"sketch": "contact.ino"
|
||||||
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
{
|
||||||
|
"python.linting.pylintEnabled": true,
|
||||||
|
"python.linting.enabled": true
|
||||||
|
}
|
||||||
7
controller.py
Normal file
7
controller.py
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
import serial
|
||||||
|
ser = serial.Serial('/dev/ttyUSB0', 115200)
|
||||||
|
print(ser.name)
|
||||||
|
|
||||||
|
while 1:
|
||||||
|
line = ser.readline() # read a '\n' terminated line
|
||||||
|
print(line)
|
||||||
12
sketch_september3a/.theia/launch.json
Normal file
12
sketch_september3a/.theia/launch.json
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
// Use IntelliSense to learn about possible attributes.
|
||||||
|
// Hover to view descriptions of existing attributes.
|
||||||
|
"version": "0.2.0",
|
||||||
|
"configurations": [
|
||||||
|
{
|
||||||
|
"name": "Arduino",
|
||||||
|
"type": "arduino",
|
||||||
|
"request": "launch"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
Binary file not shown.
BIN
sketch_september3a/sketch_september3a.esp32.esp32.firebeetle32.elf
Executable file
BIN
sketch_september3a/sketch_september3a.esp32.esp32.firebeetle32.elf
Executable file
Binary file not shown.
Binary file not shown.
@@ -4,7 +4,6 @@
|
|||||||
#include <MFRC522.h>
|
#include <MFRC522.h>
|
||||||
#define SS_PIN 5
|
#define SS_PIN 5
|
||||||
#define RST_PIN 9//not used for esp32
|
#define RST_PIN 9//not used for esp32
|
||||||
|
|
||||||
byte readCard[4];
|
byte readCard[4];
|
||||||
MFRC522 mfrc522(SS_PIN, RST_PIN);
|
MFRC522 mfrc522(SS_PIN, RST_PIN);
|
||||||
|
|
||||||
@@ -39,11 +38,10 @@ void setup() {
|
|||||||
// Bring Up Wifi
|
// Bring Up Wifi
|
||||||
WiFi.begin(ssid, password);
|
WiFi.begin(ssid, password);
|
||||||
|
|
||||||
//while (WiFi.status() != WL_CONNECTED) {
|
while (WiFi.status() != WL_CONNECTED) {
|
||||||
// delay(100);
|
delay(100);
|
||||||
// Serial.print(".");
|
Serial.print(".");
|
||||||
//}
|
}
|
||||||
|
|
||||||
Serial.println();
|
Serial.println();
|
||||||
Serial.print("IP: ");
|
Serial.print("IP: ");
|
||||||
Serial.println(WiFi.localIP());
|
Serial.println(WiFi.localIP());
|
||||||
@@ -53,19 +51,19 @@ void setup() {
|
|||||||
mfrc522.PCD_Init();
|
mfrc522.PCD_Init();
|
||||||
|
|
||||||
// Piep
|
// Piep
|
||||||
ledcSetup(channel, freq, resolution);
|
// ledcSetup(channel, freq, resolution);
|
||||||
ledcAttachPin(27, channel);
|
// ledcAttachPin(27, channel);
|
||||||
for (int i = 0; i<20000; i=i+100){
|
// for (int i = 0; i<20000; i=i+100){
|
||||||
ledcWriteTone(channel, i);
|
// ledcWriteTone(channel, i);
|
||||||
Serial.println(i);
|
// Serial.println(i);
|
||||||
delay(200);
|
// delay(200);
|
||||||
}
|
// }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void loop() {
|
void loop() {
|
||||||
//if(WiFi.status()== WL_CONNECTED){
|
if(WiFi.status()== WL_CONNECTED){
|
||||||
if ( ! mfrc522.PICC_IsNewCardPresent()) {
|
if ( ! mfrc522.PICC_IsNewCardPresent()) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -79,8 +77,8 @@ void loop() {
|
|||||||
Serial.print(readCard[i], HEX);
|
Serial.print(readCard[i], HEX);
|
||||||
CardID=CardID+String(readCard[i], HEX);
|
CardID=CardID+String(readCard[i], HEX);
|
||||||
}
|
}
|
||||||
//sendData(CardID);
|
sendData(CardID);
|
||||||
Serial.println("");
|
Serial.println("");
|
||||||
mfrc522.PICC_HaltA();
|
mfrc522.PICC_HaltA();
|
||||||
//}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user