Compare commits

..

3 Commits

Author SHA1 Message Date
Profouzors (LE) af67a9ce6b SLAVE FIN 2022-11-03 10:55:02 +01:00
Profouzors (LE) 7cb87432f3 Création Slave 2022-11-03 10:54:28 +01:00
Profouzors (LE) bcbd0e2688 Creation Branche SlaveOnly 2022-11-02 19:30:04 +01:00
2 changed files with 25 additions and 6 deletions

View File

@ -8,8 +8,8 @@
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
[env:uno]
[env:nanoatmega328]
platform = atmelavr
board = uno
board = nanoatmega328
framework = arduino
lib_deps = featherfly/SoftwareSerial@^1.0

View File

@ -1,21 +1,40 @@
/*
==== CUIZZMASTER ====
Basé sur Arduino Uno R3 (Atmel MEGA328P)
Basé sur Arduino Nano (Atmel MEGA328P) - Service Slave Seulement
*/
#include <Arduino.h>
#include <SoftwareSerial.h>
// Définition des PIN
#define CUIZZ_VERSION "1.0"
#define CUIZZ_HC12SERIAL_RX 11
#define CUIZZ_HC12SERIAL_TX 10
SoftwareSerial HC12(CUIZZ_HC12SERIAL_RX,CUIZZ_HC12SERIAL_TX)
SoftwareSerial HC12(CUIZZ_HC12SERIAL_RX,CUIZZ_HC12SERIAL_TX);
void setup() {
// put your setup code here, to run once:
// Initialisation
// Open serial communications and wait for port to open:
Serial.begin(9600);
while (!Serial) {
; // wait for serial port to connect. Needed for native USB port only
}
HC12.begin(9600);
// Initialisation Slave ONLY
Serial.print("CUIZZMASTER - v");
Serial.println(CUIZZ_VERSION);
Serial.println("INIT OK");
}
void loop() {
// put your main code here, to run repeatedly:
if (HC12.available()) {
Serial.write(HC12.read());
}
if (Serial.available()) {
HC12.write(Serial.read());
}
}