Arduino Mini PRO / Nano et HC-12

Bonjour à tous

Je suis en train de me battre avec mes nouveau module RF HC-12.

J'ai donc:
Un arduino NANO
Un Arduino Mini pro 3.3v

Avec chacun un HC-12 de branché dessus sur les ports 9 (RX) et 11 (TX)

Mais impossible de les faire fonctionné, voila les programme utilisé:

//HC-12 Momentary Button Send
//Autor Tom Heylen tomtomheylen.com


#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 11); //RX, TX

void setup() {

  mySerial.begin(9600);
}

void loop() {
 
    mySerial.println(1111);//send unique code to the receiver to turn on. In this case 1111
 delay(2000);
    mySerial.println(0000);//send unique code to the receiver to turn off. In this case 0000
 delay(2000);
}
//HC-12 Momentary Button Receive
//Autor Tom Heylen tomtomheylen.com


#include <SoftwareSerial.h>

SoftwareSerial mySerial(9, 11); // RX, TX

int ledPin = 13;

void setup() {
  mySerial.begin(9600);
  Serial.begin(9600);
  pinMode(ledPin, OUTPUT);

digitalWrite(ledPin, HIGH);//turn LED on
delay(1000);
digitalWrite(ledPin, LOW);//turn LED on
  
}

void loop() {
   
  if(mySerial.available() > 1){    
    int input = mySerial.parseInt();//read serial input and convert to integer (-32,768 to 32,767) 
     
      Serial.print(input);
      
    if(input == 1111){//if on code is received
      digitalWrite(ledPin, HIGH);//turn LED on
    }
    if(input == 0000){//if off code is received
      digitalWrite(ledPin, LOW);//turn LED off
    }
  }
  mySerial.flush();//clear the serial buffer for unwanted inputs     
  
  delay(20);//delay little for better serial communication
 
}

les codes ont été trouver sur le net, sur un tuto pour utilisé les HC-12.
J'ai juste modifier la partie "émission" pour quelle envoie alternativement le code 1111 et 0000.

Sur l'arduino récepteur, je reçois bien quelque chose (que j'envoie sur le port série du pc)
Je reçois uniquement un zéro.

Merci de votre aide !!!!

SoftwareSerial mySerial(9, 11); // RX, TX

==> La pin 9 va au RX de votre HC-12 et la 11 au Tx?

SoftwareSerial(rxPin, txPin, inverse_logic)

Parameters
rxPin: the pin on which to receive serial data
txPin: the pin on which to transmit serial data
inverse_logic: is used to invert the sense of incoming bits (the default is normal logic). If set, SoftwareSerial treats a LOW (0 volts on the pin, normally) on the Rx pin as a 1-bit (the idle state) and a HIGH (5 volts on the pin, normally) as a 0-bit. It also affects the way that it writes to the Tx pin. Default value is false.

yep

Et donc....

tout est bien cablé

ça veut dire quoi bien câblé?

Hello

j'ai trouvé mon probleme:

C'est pas des Arduino Mini pro en 3.3v que j'ai recu.
J'ai reçu des 5v, du coup avec le bon arduino dans l'ide, ça marche beaucoup mieux !!!