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
/* | |
Chirp - arduino example | |
Connection | |
Chirp pin 1 - no connection | |
Chirp pin 2 - Arduino VCC | |
Chirp pin 3 - Arduino A5 | |
Chirp pin 4 - Arduino A4 | |
Chirp pin 5 - Arduino pin 2 | |
Chirp pin 6 - Arduino GND |
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
void process_led(void) | |
{ | |
char cmd_cnt=0; | |
char cmd_All[5]; | |
if(no_carroer==1) | |
{ | |
return; | |
} | |
Serial1.flush(); | |
delay(500); |
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
void wait_password(void) | |
{ | |
char num_pass[10]; | |
char pass_cnt=0; | |
Serial.flush(); | |
Serial2.flush(); | |
Serial1.write(0x02); | |
while(1) | |
{ | |
String data = rx_m10(); |
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
void wait_Ring(void) | |
{ | |
char RingConunt=0; | |
char RingTime=3; | |
no_carroer=0; | |
while(1) | |
{ | |
String data = rx_m10(); | |
if(data == "RING") | |
{ |
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
String rx_m10(void) | |
{ | |
if (Serial2.available()) | |
{ | |
c = Serial2.read(); | |
if((c != 0x0D)&&(c != 0x0A)) | |
{ | |
str[cnt] = c; | |
cnt++; | |
} |
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
void loop() // run over and over | |
{ | |
wait_Ring(); | |
wait_password(); | |
process_led(); | |
} |
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 <SoftwareSerial.h> | |
char c=0; | |
char str[40]; | |
char cnt=0; | |
int busy = 2; | |
int LED1 = 3; | |
int LED2 = 4; | |
int LED3 = 5; | |
int LED4 = 6; | |
String password="1234"; |
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
void serialEvent() | |
{ | |
byte buff; | |
if(Serial.available()) | |
{ | |
buff = Serial.read(); | |
if(buff == 59) | |
{ | |
serial_index = 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
void shiftOutSPI( unsigned char dat ) | |
{ | |
digitalWrite( STCP_PIN, LOW); | |
digitalWrite( STCP_PIN, LOW ); | |
SPI.transfer(dat); | |
digitalWrite( STCP_PIN, HIGH ); | |
digitalWrite( STCP_PIN, LOW ); | |
} |
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
void Scan_Line( unsigned char m) | |
{ | |
switch(m) | |
{ | |
case 0: | |
digitalWrite(LEDARRAY_D, LOW);digitalWrite(LEDARRAY_C, LOW);digitalWrite(LEDARRAY_B, LOW);digitalWrite(LEDARRAY_A, LOW); | |
break; | |
case 1: | |
digitalWrite(LEDARRAY_D, LOW);digitalWrite(LEDARRAY_C, LOW);digitalWrite(LEDARRAY_B, LOW);digitalWrite(LEDARRAY_A, HIGH); | |
break; |
NewerOlder