Skip to content

Instantly share code, notes, and snippets.

View marcelo-reis's full-sized avatar

Marcelo Alves dos Reis marcelo-reis

  • São Paulo-SP/Brasil
View GitHub Profile
@marcelo-reis
marcelo-reis / calc01.c
Last active May 10, 2019 00:00
C - Uma calculadora simples, recebe 2 numerais e efetua operações matemáticas básicas.
#include <stdio.h >
#include <stdlib.h>
int main(){
// Declaração de variáveis
int num1, // Primeiro numeral
num2, // Segundo numeral
sum , // Soma
sub , // Subtração
mult; // Multiplicação
@marcelo-reis
marcelo-reis / myPiano.ino
Last active May 9, 2019 23:59
Arduino - Faz um pequeno piano de 3 Botões, onde cada botão toca um trecho de musica em um Buzzer e acende um LED correspondente.
const int BUZZER = 10; // Buzzer
const int LED_RED = 13; // Led Vermelho
const int LED_YLW = 12; // Led Amarelo
const int LED_GRN = 11; // Led Verde
const int BTN_RED = 9; // Botão Vermelho
const int BTN_YLW = 8; // Botão Amarelo
const int BTN_GRN = 7; // Botão Verde
// Frequencias de cada nota musical
const int C = 261; // Dó
@marcelo-reis
marcelo-reis / openinbrowser.py
Last active May 9, 2019 23:58
Python - Para abrir várias páginas web através da classe "webbrowser" lendo arquivo ".txt" com os endereços
import webbrowser
with open ('.../myscripts/myadress.txt') as f:
for url in f.readlines():
webbrowser.open(url)
@marcelo-reis
marcelo-reis / hello_world_from_web.py
Last active October 28, 2020 21:09
Python - A great way to start!
URL = 'https://pt.wikipedia.org/wiki/Programa_Ol%C3%A1_Mundo'
hw = ''
import urllib.request
try:
texto = urllib.request.urlopen(URL).read().decode('utf-8')
onde = texto.find('<title>')
except urllib.error.HTTPError:
print('Endereço Inválido')
except urllib.error.URLError:
@marcelo-reis
marcelo-reis / hello_world.py
Last active July 18, 2018 00:04
To have good luck!
a = 'hell'
b = 'o, w'
c = 'orld'
print(a+b+c+'!')