Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions keywords.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ escreverSerialEspecial KEYWORD1
escreverSerialnEspecial KEYWORD1
Ultrassom KEYWORD1
Motor KEYWORD1
iniciarAleatorio KEYWORD1

#######################################
# Metodos e Funções (KEYWORD2)
Expand Down Expand Up @@ -54,6 +55,7 @@ tangente KEYWORD2
configurarVelocidade KEYWORD2
girar KEYWORD2
parar KEYWORD2
aleatorio KEYWORD2

# Ultrassom
lerDistancia KEYWORD2
Expand Down
8 changes: 6 additions & 2 deletions src/Brasilino.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,18 @@ void Motor::parar() {
digitalWrite(_pino_B, LOW);
}

void iniciarAleatorio() {
randomSeed(analogRead(A0));
}

void iniciarAleatorio(unsigned long seed){
randomSeed(seed);
}

int aleatorio(int max){
random(max + 1);
return random(max + 1);
}

int aleatorio(int min, int max){
random(min, max + 1);
return random(min, max + 1);
}
Loading