Sie sind auf Seite 1von 2

DS18B20 .

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

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

Chuleta de Pingino

USB
USB .
USB .
USB .
USB .

available
read
send
sendint

Nelo R. Tovar

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

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>

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

/ / p r e c o m p i l a c i o n
# ifndef inicio condicional
# endif fin condicional

Sound
Sound
Play

Calificadores
Serial
Serial
Serial
Serial
Serial
Serial
Serial
Serial
Serial

.
.
.
.
.
.
.
.

available
begin
flush
getkey
init
print
printf
read

Servo
servo
servo
servo
servo
servo
servo

. attach
. detach
. read
. setMaximumPulse
. setMinimumPulse
. write

Chuleta de Pingino V-0.1


Hecho por Nelo R. Tovar, con el uso de LATEX, 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

const
static
extern
volatile

// solo lectura
/ / p e r s i s t e entre llamadas
/ / declaracion externa
/ / u s a l a RAM

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

switch ( variable ) {
case 1 :
break ;
case 2 :
break ;
default :
}
f o r ( i = 0 ; i <= a ; i + + ) {
b = b + i;
}

s h o r t ( 32 ,768 a 3 2 , 7 6 7 )
unsigned short (0 a 65 ,535)

TRUE ( 1 ) FALSE ( 0 )
HIGH ( 1 ) LOW ( 0 )
INPUT OUTPUT

i n t ( 32 ,768 a 3 2 , 7 6 7 )
unsigned i n t (0 a 65 ,535)

0 x01101100L / / binario
0 x3F / / h e x a d e c i m a l

long ( 2 ,147 ,483 a 2 , 1 4 7 , 4 8 3 , 6 4 7 )


unsigned long (0 a 4 ,294 ,967 ,295)

Funciones heredadas Wiring/Arduino

f l o a t , d o u b l e , b y t e , word

Estructura Bsicas
void setup {

Acceso a Punteros
while ( a < b ) {

& Refiere Direccion


R e f i e r e Contenido

}
do {
} while ( a < b ) ;
continue break
aplicable a :
do / f o r / w h i l e

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
<float.h> Constantes para Operaciones Punto flotante
<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>Definicin de Tipo Booleano
<stddef.h> Definicin de Macros de Utilidad diversa
<stdint.h> Definicin 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

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)

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 ;

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

}
void loop {
}

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

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 } ;

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
}

Librerias especficas de Pingino


1wire
1 wire
1 wire
1 wire
1 wire
1 wire

.
.
.
.
.

readbit
readbyte
reset
writebit
writebyte

Interrupt
UserInterrup

CDC
Tipos Enumerados
enum enumerado {
dato1 ,
dato2 ,
datoN
} variable ;

Constantes

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

Das könnte Ihnen auch gefallen