This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SD.h> | |
#define FILE_NM "-NKK-LOG.GPS" | |
#define SER_SP 9600 | |
#define GPS_MIN_LEN 40 | |
#define BLUE_OFF PORTC &= 0b111111000 // Тушим синие светодиоды. | |
#define RED_ON PORTC |= 0b000001000 // Зажигаем или | |
#define RED_OFF PORTC &= 0b111110111 // тушим красный светодиод. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <SD.h> | |
#define pinErr 16 // Некий внешний светодиод, не 13. | |
File flDataFile; // Переменная для работы с файлами. | |
unsigned long i, // Счётчик. | |
ulWrTime = 1, // Время записи в файл. | |
ulWritten = 0, // Количество записанных байт. | |
ulRdTime = 1, // Время чтения из файла. | |
ulReaded = 0; // Количество прочитанных байт. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SD.h> | |
#define SER_SP 4800 | |
#define Z_LEDS 0b111111000 | |
volatile unsigned long ulCurTickTm, // Время импульса с геркона при прерывании | |
ulPrevTickTm = 0; // и после. | |
word wTmDelta; // Время между срабатываниями геркона. | |
byte bCadence; // Каденс текущий | |
volatile byte bLastCadence = 0; // и индицируемый. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
volatile unsigned long ulLastTickTm = 0; // Время последнего импульса с геркона. | |
volatile byte bTicksCount = 0; // Количество "пролётов" геркона мимо магнита. | |
unsigned long ulLastCalc = 0; // Для заплатки. | |
volatile byte bCadence; | |
byte bLastCadence = 0; | |
unsigned long ulCalc, ulCurTickTm; | |
void setup() { | |
pinMode(2, INPUT_PULLUP); // Геркон без внешнего резистора, | |
attachInterrupt(0, evOnTick, FALLING); // прерывание по его срабатыванию. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <SD.h> | |
#define SER_SP 9600 // Скорость порта, такая же, как на GPS-модуле! | |
File flDataFile; // Файл для записи GPS-строк. | |
word uFileNo = 0; // Номер файла. | |
byte btBlinkCount = 0; // Количество пыхов светодиода. | |
char chGpsLint[128]; // Переменная для хранения GPS-строки, | |
byte btReaded; // её длина. |