Jump to content

Samuel Andriotte

1-Participants
  • Posts

    13
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Samuel Andriotte's Achievements

Explorer

Explorer (4/14)

  • Collaborator
  • Reacting Well
  • First Post
  • Conversation Starter
  • One Month Later

Recent Badges

0

Reputation

Single Status Update

See all updates by Samuel Andriotte

  1. SPIRIT BOX 2 VERSÕES, ARDUINO UNO + TEA5767

    SEM RUÍDO BRANCO.
    ----------------------------------------------------------------

    #include <Wire.h>
    #include <TEA5767.h>

    TEA5767 radio;

    int scanningDelay = 100;  // Delay entre cada varredura (em milissegundos)

    void setup() {
      Serial.begin(9600);
      Wire.begin();
    }

    void loop() {
      // Realiza a varredura de frequências
      for (float frequency = 87.5; frequency <= 108.0; frequency += 0.1) {
        radio.setFrequency(frequency);
        radio.setMuted(false); // Ativa o som

        // Aguarda por um tempo antes de passar para a próxima estação
        delay(scanningDelay);
        
        // Lê informações sobre a estação atual
        float currentFrequency = radio.getFrequency();
        int signalLevel = radio.getSignalLevel();
        
        Serial.print("Frequência: ");
        Serial.print(currentFrequency);
        Serial.print(" MHz, Nível do Sinal: ");
        Serial.println(signalLevel);
      }
    }

    ___________________________________________________________________________________
    COM RUÍDO BRANCO
    _____________________________________________________________________

    #include <Wire.h>
    #include <TEA5767.h>

    TEA5767 radio;

    int scanningDelay = 100;  // Delay entre cada varredura (em milissegundos)

    void setup() {
      Serial.begin(9600);
      Wire.begin();
    }

    void loop() {
      // Realiza a varredura de frequências
      for (float frequency = 87.5; frequency <= 108.0; frequency += 0.1) {
        radio.setFrequency(frequency);
        radio.setMuted(false); // Ativa o som

        // Aguarda por um tempo antes de passar para a próxima estação
        delay(scanningDelay);
        
        // Lê informações sobre a estação atual
        float currentFrequency = radio.getFrequency();
        int signalLevel = radio.getSignalLevel();

        // Gera um número aleatório entre 0 e 1
        float randomValue = random(0, 1);

        // Verifica se o número aleatório é menor que um limite para reproduzir o áudio
        if (randomValue < 0.2) {
          // Reproduzir áudio (ruído branco, por exemplo)
          Serial.println("Audio reproduzido");
        }
        
        Serial.print("Frequência: ");
        Serial.print(currentFrequency);
        Serial.print(" MHz, Nível do Sinal: ");
        Serial.println(signalLevel);
      }
    }

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.