Line 1... |
Line -... |
1 |
//#include "C:\Users\Honza\Documents\pic\I2C_HUB\main.h" |
- |
|
2 |
|
- |
|
3 |
#include "main.h" |
1 |
#include "main.h" |
4 |
//I2CHUB |
2 |
//I2CHUB |
5 |
//ADRESA pro èteni 0xE1 |
3 |
//ADRESA pro èteni 0xE1 |
6 |
//pro zápis 0xE0 |
4 |
//pro zápis 0xE0 |
7 |
|
5 |
|
8 |
|
- |
|
9 |
#define EEPROM_SDA PIN_C4 |
- |
|
10 |
#define EEPROM_SCL PIN_C3 |
- |
|
11 |
#use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL) |
6 |
#use i2c(master, sda=PIN_C4, scl=PIN_C3) |
12 |
#use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD |
7 |
#use rs232(baud=9600,parity=N,xmit=PIN_C7,rcv=PIN_C6,bits=8) //rcv TXD xmit RXD |
13 |
|
8 |
|
14 |
void setHUB(int d) //vstupuje 1-8 |
9 |
void setHUB(int d) //vstupuje 1-8 |
15 |
//hodnota udava jaky port bude pripojen na master I2C |
10 |
//hodnota udava jaky port bude pripojen na master I2C |
16 |
//zde je nastaveno propojeni jen jedne brany, je mozne propojit i vice bran naraz |
11 |
//zde je nastaveno propojeni jen jedne brany, je mozne propojit i vice bran naraz |