/Modules/Sensors/MAG01A/SW/PIC16F887/main.bak
1,17 → 1,8
//Magnetometr Jan Chroust 2013
//vypise hodnoty jednotlivych os
 
#include "main.h"
#include "HMC5883L.h"
#define EEPROM_SDA PIN_B0
#define EEPROM_SCL PIN_B1
#use i2c(master, sda=EEPROM_SDA, scl=EEPROM_SCL)
#use rs232(baud=9600,parity=N,xmit=PIN_B3,rcv=PIN_B2,bits=8) //rcv TXD xmit RXD
 
 
void main()
{
 
setup_adc_ports(NO_ANALOGS|VSS_VDD);
setup_adc(ADC_CLOCK_DIV_2);
setup_spi(SPI_SS_DISABLED);
26,7 → 17,6
printf("Vysledky z jednotlivych os:\r\n",);
signed int16 X,Y,Z;
 
 
while(true)
{
printf("Vysledky z jednotlivych os:\r\n",);
36,7 → 26,7
printf("X: %Ld \r\n", X);
printf("Y %Ld \r\n", Y);
printf("Z: %Ld \r\n", Z);
Delay_ms(2000);
Delay_ms(500);
}
}