Skip to content

Instantly share code, notes, and snippets.

@tuxcuiabano
tuxcuiabano / prova2msia.c
Last active November 1, 2016 03:13
Prova 2 MSI A
//
// main.c
// Prova
//
// Created by Pedro Clarindo da Silva Neto on 26/09/16.
// Copyright © 2016 Pedro Clarindo da Silva Neto. All rights reserved.
//
#include <stdio.h>
#include <stdlib.h>
@tuxcuiabano
tuxcuiabano / funcmaximo.c
Last active September 24, 2016 18:00
Função Máximo
#include <stdio.h>
int maximo (int x,int y, int z);
int main()
{
// printf("Hello, World!\n");
int num1,num2,num3;
printf("Digite 3 numeros\n");
scanf("%d%d%d",&num1,&num2,&num3);
@tuxcuiabano
tuxcuiabano / forencadeado.c
Last active September 9, 2016 15:50
Para encadeado
#include <stdio.h>
int main(){
int i;
int j;
int tab;
for(i=2;i<=10;i++){
printf("Tabuada do %d\n",i);
for(j=0;j<=10;j++){
tab = i * j;
printf("%d x %d = %d\n",i,j,tab);
@tuxcuiabano
tuxcuiabano / enquantoencadeado.c
Last active September 8, 2016 18:30
Enquanto Encadeado
#include <stdio.h>
int main(){
int i=2;
int j=0;
int tab;
while(i<=10){
printf("Tabuada do %d\n",i);
while(j<=10){
tab = i * j;
printf("%d x %d = %d\n",i,j,tab);
@tuxcuiabano
tuxcuiabano / forcalivrosimonmonk.py
Created December 23, 2014 01:30
[Python] Forca - Livro Simon Monk
import random
palavras = ['frango','cachorro','gato','rato','sapo']
vidas_restantes = 14
letras_advinhadas=''
def escolhe_palavra():
posicao_palavra = random.randint(0, len(palavras)-1)
return palavras[posicao_palavra]
def jogar():
@tuxcuiabano
tuxcuiabano / testeondewire18b20.ino
Created December 18, 2014 04:20
[Arduíno] Testando One Wire 18B20
#include <OneWire.h>
#include <Arduino.h>
int SensorPin = 10;
OneWire ds(SensorPin);
void setup(void) {
Serial.begin(9600);
@tuxcuiabano
tuxcuiabano / cap13proj37sensoronewire.ino
Created December 18, 2014 04:18
[Arduíno] Cap 13 Projeto 37 part1 Sensor digital de Temperatura OneWire - OK
// Project 37 - Part 1
#include <OneWire.h>
#include <DallasTemperature.h>
// Data line goes to digital pin 3
#define ONE_WIRE_BUS 3
// Setup a oneWire instance to communicate with any OneWire devices (not just Maxim/Dallas temperature ICs)
OneWire oneWire(ONE_WIRE_BUS);
@tuxcuiabano
tuxcuiabano / cap17proj46ethernet.ino
Created December 18, 2014 04:16
[Arduíno] Cap 17 Projeto 46 Ethernet - OK
// Project 46 – Based on the Arduino Webserver example by David A. Mellis and Tom Igoe
//Bibliotecas novas adicionadas posteriormente por causa da mudança para nova IDE
#include <Dhcp.h>
#include <Dns.h>
#include <Ethernet.h>
#include <EthernetClient.h>
#include <EthernetServer.h>
#include <EthernetUdp.h>
#include <Arduino.h>
@tuxcuiabano
tuxcuiabano / arduinoleiturarfid.ino
Last active August 29, 2015 14:11
[Arduíno] Leitura RFID - OK
#include <SoftwareSerial.h>
SoftwareSerial rfidReader(2, 3); //Pin 2 - RX /Pin 3 - TX
char c= 0; // value read for serial port
void setup() {
Serial.begin(9600); //setup the Serial speed
rfidReader.begin(9600); //setup the Rfid reader speed
}
@tuxcuiabano
tuxcuiabano / arduinotestelcdok.ino
Last active August 29, 2015 14:11
[Arduíno] Teste LCD - OK
/*
LiquidCrystal Library - Hello World
Demonstrates the use a 16x2 LCD display. The LiquidCrystal
library works with all LCD displays that are compatible with the
Hitachi HD44780 driver. There are many of them out there, and you
can usually tell them by the 16-pin interface.
This sketch prints "Hello World!" to the LCD
and shows the time.