You are on page 1of 2

DS18B20 . G e t F i r s t DS18B20 . G e t N e x t DS18B20 . MatchRom DS18B20 . Read DS18B20 .

ReadRom

USB
USB . USB . USB . USB . available read send sendint

Chuleta de Pingino
Nelo R. Tovar

LCD
lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd lcd . autoscroll . begin . blink . clear . command . cursor . display . home . init . leftToRight . noAutoscroll . noBlink . noCursor . noDisplay . print . printFloat . printNumber . rightToLeft . scrollDisplayLeft . scrollDisplayRight . send . setCursor . write

Protoboard

http://www.pinguino.org.ve
@pinguinove en Identi.ca y Twitter

SDCC Referencia Rpida


Small Device C Compiler es el compilador de C ANSI utilizado por el IDE de Pingino. Comentarios
/ / Comentario por l i n e a / Comentario m u l t i l i n e a

Directivas #
# define constante valor # d e f i n e macro f u n c i o n ( ) # i n c l u d e < l i b r e r i a . h> / / p r e c o m p i l a c i o n # ifndef inicio condicional # endif fin condicional

PWM
PWM. s e t d u t y c y c l e PWM. s e t f r e q u e n c y PWM. s e t p e r c e n t d u t y c y c l e

Sound
Sound Play

Cali cadores Serial


Serial Serial Serial Serial Serial Serial Serial Serial . . . . . . . . available begin flush getkey init print printf read const static extern volatile // solo lectura / / p e r s i s t e entre llamadas / / declaracion externa / / u s a l a RAM

Chuleta de Pingino V-0.1


A Hecho por Nelo R. Tovar, con el uso de LTEX, basado en la Hoja de Referencia de Pingino V-1.0. Distribuido bajo la Licencia Creative Commons V-3.0 BY-NC-SA. Ms info en : http://www.pinguino.org.ve Sguenos en Identi.ca y Twitter : @pinguinove

Estructura de Control
if (a < b) { } else { } if (a < b) { } else if ( a > b) { }

Servo
servo servo servo servo servo servo . attach . detach . read . setMaximumPulse . setMinimumPulse . write

switch ( variable ) { case 1 : break ; case 2 : break ; default : } f o r ( i = 0 ; i <= a ; i + + ) { b = b + i; } while ( a < b ) { } do { } while ( a < b ) ; continue break aplicable a : do / f o r / w h i l e

s h o r t ( 32 ,768 a 3 2 , 7 6 7 ) unsigned short (0 a 65 ,535) i n t ( 32 ,768 a 3 2 , 7 6 7 ) unsigned i n t (0 a 65 ,535) long ( 2 ,147 ,483 a 2 , 1 4 7 , 4 8 3 , 6 4 7 ) unsigned long (0 a 4 ,294 ,967 ,295) f l o a t , d o u b l e , b y t e , word

TRUE ( 1 ) FALSE ( 0 ) HIGH ( 1 ) LOW ( 0 ) INPUT OUTPUT 0 x01101100L / / binario 0 x3F / / h e x a d e c i m a l

Funciones heredadas Wiring/Arduino


Estructura Bsicas
void setup { } void loop { }

Acceso a Punteros
& Refiere Direccion R e f i e r e Contenido

Tipo Compuestos
struct registro { t i p o campo1 ; t i p o campoN ; } variable ; union d a t o s { tipo1 dato1 ; tipo2 dato2 ; } variable ; t y p e d e f t i p o nuevoTipo ;

Wiring (Base)
abs analogRead analogWrite cos delay delayMicroseconds digitalRead digitalWrite millis pinMode pow randomSeed sin sqrt tan

Librerias SDCC para la Plataforma PIC16 incluidas en el IDE


Nombre Propsito de las Funciones que contiene <ctype.h> Deteccin de tipos, Conv. Mays/Mins <errno.h> Prueba de cdigos de Error Devueltos < oat.h> Constantes para Operaciones Punto otante <limits.h> Declaracin de valores Mximos y Mnimos <math.h> Funciones Matemticas ms comunes <signal.h> Intercambio de Seales de Procesos <stdarg.h> Paso de argumentos en cantidad variable <stdbool.h>De nicin de Tipo Booleano <stddef.h> De nicin de Macros de Utilidad diversa <stdint.h> De nicin de Tipo de Datos Enteros <stdio.h> Capacidades de Entrada y Salida Estndar <stdlib.h> Funciones Miscelneas Estndar <string.h> Manipulacin de Cadenas de Caracateres

Arreglos (Vectores)
i n t Datos [ 5 ] ; i n t Datos [ ] = { 5 , 6 , 7 } ; int datos [3] = {8 , 9 , 1 0 } ;

Cadena de Caracteres
char char char char char Cad [ 6 ] ; Cad [ ] = c a d e n a ; Cad [ 4 ] = u s b ; Cad [ 1 0 ] = c a d e n a ; Cad [ 2 ] = { u , \ n } ;

Librerias espec cas de Pingino


1wire
1 wire 1 wire 1 wire 1 wire 1 wire . . . . . readbit readbyte reset writebit writebyte

Campos de Bits (Flags)


struct { unsigned BIT_0 : 1 unsigned BIT_1 : 1 \ ldots u n s i g n e d BIT_N : 1 }

Interrupt
UserInterrup

Tipos y Estructuras de Datos


Tipo de Datos Escalares
void BOOL / / c o n < s t d b o o l . h > c h a r ( 128 a 1 2 7 ) unsigned char (0 a 255)

CDC Tipos Enumerados


enum enumerado { dato1 , dato2 , datoN } variable ; CDC . p r i n t CDC . r e a d

DS18B20 (I2C)
DS18B20 . C o n f i g u r e DS18B20 . c r c DS18B20 . F i n d

Constantes

You might also like