Inteligencias Multiples
Practica 1 * Esta practica consistía en la elaboración de 2 semáforos cada uno con su respectivo semáforo peatonal. |
Gutiérrez Contreras Mariela
Ibarra Rodríguez PedroJuárez Aguilar BoscoRomo Martínez MicheelSantiago Torres Raúl |
Proyecto Integrador y Comprensivo I |
Diagrama de flujo Semaforos (Crucero)
MACRO B MACRO A
#define MX_PIC
//Definiciones para elmicrocontrolador
#define P16F877A
#define MX_EE
#define MX_EE_TYPE2
#define MX_EE_SIZE 256
#define MX_SPI
#define MX_SPI_C
#define MX_SPI_SDI 4
#define MX_SPI_SDO 5
#define MX_SPI_SCK 3
#define MX_UART
#define MX_UART_C
#define MX_UART_TX 6
#define MX_UART_RX 7
#define MX_I2C
#define MX_MI2C
#define MX_I2C_C
#define MX_I2C_SDA 4
#define MX_I2C_SCL 3
#define MX_PWM
#defineMX_PWM_CNT 2
#define MX_PWM_TRIS1 trisc
#define MX_PWM_1 2
#define MX_PWM_TRIS2 trisc
#define MX_PWM_2 1
//Funciones
#define MX_CLK_SPEED 4000000
#ifdef _BOOSTC
#include <system.h>
#endif
#ifdef HI_TECH_C
#include <pic.h>
#endif
//Datos de configuración
#ifdef _BOOSTC
#pragma DATA 0x2007, 0x3fba
#endif
#ifdef HI_TECH_C
__CONFIG(0x3fba);
#endif
//Funciones internas#include "C:\Archivos de programa\Matrix Multimedia\Flowcode V4\FCD\internals.h"
//Macro function declarations
void FCM_A();
void FCM_B();
//Variable declarations
char FCV_A;
//Macro implementations
void FCM_A()
{
//Salida
//Salida: 0 -> B1
trisb = trisb & 0xfd;
if (0)
portb = (portb & 0xfd) | 0x02;
else
portb = portb & 0xfd;
//Salida
//Salida: 0 ->C3
trisc = trisc & 0xf7;
if (0)
portc = (portc & 0xf7) | 0x08;
else
portc = portc & 0xf7;
//Demora
//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//Salida
//Salida: 1 -> B1
trisb = trisb & 0xfd;
if (1)
portb = (portb & 0xfd) | 0x02;
else
portb = portb & 0xfd;
//Salida
//Salida: 1 -> C3
trisc = trisc & 0xf7;
if (1)portc = (portc & 0xf7) | 0x08;
else
portc = portc & 0xf7;
//Demora
//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//Salida
//Salida: 0 -> B1
trisb = trisb & 0xfd;
if (0)
portb = (portb & 0xfd) | 0x02;
else
portb = portb & 0xfd;
//Salida
//Salida: 0 -> C3
trisc = trisc & 0xf7;
if (0)
portc = (portc & 0xf7) | 0x08;
elseportc = portc & 0xf7;
//Demora
//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//Salida
//Salida: 1 -> B1
trisb = trisb & 0xfd;
if (1)
portb = (portb & 0xfd) | 0x02;
else
portb = portb & 0xfd;
//Salida
//Salida: 1 -> C3
trisc = trisc & 0xf7;
if (1)
portc = (portc & 0xf7) | 0x08;
else
portc = portc & 0xf7;
//Demora//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//Salida
//Salida: 0 -> B1
trisb = trisb & 0xfd;
if (0)
portb = (portb & 0xfd) | 0x02;
else
portb = portb & 0xfd;
//Salida
//Salida: 0 -> C3
trisc = trisc & 0xf7;
if (0)
portc = (portc & 0xf7) | 0x08;
else
portc = portc & 0xf7;
}
void FCM_B()
{
//Salida
//Salida: 0 -> B4
trisb= trisb & 0xef;
if (0)
portb = (portb & 0xef) | 0x10;
else
portb = portb & 0xef;
//Salida
//Salida: 0 -> C0
trisc = trisc & 0xfe;
if (0)
portc = (portc & 0xfe) | 0x01;
else
portc = portc & 0xfe;
//Demora
//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//
//Salida: 1 -> B4
trisb = trisb & 0xef;
if (1)
portb = (portb& 0xef) | 0x10;
else
portb = portb & 0xef;
//Salida
//Salida: 1 -> C0
trisc = trisc & 0xfe;
if (1)
portc = (portc & 0xfe) | 0x01;
else
portc = portc & 0xfe;
//Demora
//Demora: 500 ms
delay_ms(255);
delay_ms(245);
//Salida
//Salida: 0 -> B4
trisb = trisb & 0xef;
if (0)
portb = (portb & 0xef) | 0x10;
else
portb =...
Regístrate para leer el documento completo.