Compare commits

..

No commits in common. "OnlySlave_ArduinoNano" and "master" have entirely different histories.

2 changed files with 6 additions and 25 deletions

View File

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

View File

@ -1,40 +1,21 @@
/* /*
==== CUIZZMASTER ==== ==== CUIZZMASTER ====
Basé sur Arduino Nano (Atmel MEGA328P) - Service Slave Seulement Basé sur Arduino Uno R3 (Atmel MEGA328P)
*/ */
#include <Arduino.h> #include <Arduino.h>
#include <SoftwareSerial.h> #include <SoftwareSerial.h>
// Définition des PIN // Définition des PIN
#define CUIZZ_VERSION "1.0"
#define CUIZZ_HC12SERIAL_RX 11 #define CUIZZ_HC12SERIAL_RX 11
#define CUIZZ_HC12SERIAL_TX 10 #define CUIZZ_HC12SERIAL_TX 10
SoftwareSerial HC12(CUIZZ_HC12SERIAL_RX,CUIZZ_HC12SERIAL_TX); SoftwareSerial HC12(CUIZZ_HC12SERIAL_RX,CUIZZ_HC12SERIAL_TX)
void setup() { void setup() {
// Initialisation // put your setup code here, to run once:
// 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() { void loop() {
if (HC12.available()) { // put your main code here, to run repeatedly:
Serial.write(HC12.read());
}
if (Serial.available()) {
HC12.write(Serial.read());
}
} }