@@ -255,90 +255,33 @@ Com isso, <b>seu leque de opções</b> vira o verdadeiro cinto do Batman, com di
255
255
256
256
<img id =" aplicacao " src =" img/imagens-palestra/21.png " style =" height :300px , " >
257
257
258
- ## Imagem: Aplicação Arduino + Python
258
+ Para visualizar o código e explicações com todas as integrações a seguir, basta clicar na imagem ou acessar a pasta codes do repositório.
259
259
260
260
<p align =" center " >
261
- <a href =" https://github.com/mateustoin " >
262
- <img height = " 180em " src =" img/imagens-palestra/22.png " />
261
+ <a href =" https://github.com/mateustoin/Palestra-Python-para-Arduino/blob/master/codes/Serial/arduino-python.md " >
262
+ <img src =" img/imagens-palestra/22.png " style = " height : 300 px , " />
263
263
</a >
264
264
</p >
265
265
266
- ` pip install pyserial `
267
266
268
- ``` python
269
- import serial
270
-
271
- arduino = serial.Serial(port = ' /dev/ttyACM0' , baudrate = 9600 , timeout = 1 )
272
-
273
- while True :
274
- msg = input (' Envie um comando: ' )
275
-
276
- arduino.write(bytes (msg, encoding = ' utf-8' ))
277
-
278
- retorno = arduino.readline().decode(' ascii' )
279
- print (' Retorno: ' + retorno)
280
- ```
281
-
282
- ## Imagem: Speech to Text : Comandos por voz
283
-
284
- ``` python
285
- import speech_recognition as sr
286
-
287
- # Funcao responsavel por ouvir e reconhecer a fala
288
- def ouvir_microfone ():
289
- # Habilita o microfone para ouvir o usuario
290
- microfone = sr.Recognizer()
291
- with sr.Microphone() as source:
292
- # Chama a funcao de reducao de ruido disponivel na speech_recognition
293
- microfone.adjust_for_ambient_noise(source, duration = 1 )
294
- # Avisa ao usuario que esta pronto para ouvir
295
- print (" Diga alguma coisa: " )
296
- # Armazena a informacao de audio na variavel
297
- audio = microfone.listen(source, timeout = 2 , phrase_time_limit = 4 )
298
- try :
299
- # Passa o audio para o reconhecedor de padroes do speech_recognition
300
- frase = microfone.recognize_google(audio,language = ' pt-BR' )
301
-
302
- # Caso nao tenha reconhecido o padrao de fala, exibe esta mensagem
303
- except sr.UnknownValueError:
304
- print (" Não entendi" )
305
-
306
- return frase
307
-
308
- frase = ouvir_microfone()
309
- print (' Resposta: ' + frase)
310
- ```
311
-
312
- ## Imagem: Aplicação com OpenCV : Tirando fotos
313
-
314
- ` pip install opencv-python `
315
-
316
- ``` python
317
- import cv2 # Importa biblioteca do opencv
318
-
319
- cap = cv2.VideoCapture(1 ) # Identifica a câmera do dispositivo
320
- ret,frame = cap.read() # Retorna um único frame capturado da câmera
321
-
322
- cv2.imwrite(' test.png' ,frame) # Salva o frame capturado no arquivo test.png
323
- ```
324
-
325
- ## Imagem: Acionando sons
326
-
327
- ` pip install pygame `
267
+ <p align =" center " >
268
+ <a href =" https://github.com/mateustoin/Palestra-Python-para-Arduino/blob/master/codes/speech-to-text/arduino-voz.md " >
269
+ <img src =" img/imagens-palestra/23.png " style =" height :300px , " />
270
+ </a >
271
+ </p >
328
272
329
- ``` python
330
- import pygame
331
- import time
332
273
333
- file = ' aimless-old habits.mp3 '
334
- pygame.init()
335
- pygame.mixer.init()
336
- pygame.mixer.music.load( file )
337
- pygame.mixer.music.play()
274
+ < p align = " center " >
275
+ < a href = " https://github.com/mateustoin/Palestra-Python-para-Arduino/blob/master/codes/opencv/arduino-cam.md " >
276
+ < img src = " img/imagens-palestra/24.png " style = " height : 300 px , " />
277
+ </ a >
278
+ </ p >
338
279
339
- time.sleep(10 )
340
280
341
- pygame.mixer.music.stop()
342
- ```
281
+ <p align =" center " >
282
+ <a href =" https://github.com/mateustoin/Palestra-Python-para-Arduino/blob/master/codes/pysound/arduino-som.md " >
283
+ <img src =" img/imagens-palestra/25.png " style =" height :300px , " />
284
+ </a >
285
+ </p >
343
286
344
- <img id =" contato " src =" img/imagens-palestra/22 .png " style =" height :300px , " >
287
+ <img id =" contato " src =" img/imagens-palestra/26 .png " style =" height :300px , " >
0 commit comments