This file contains hidden or 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
:local checkHost do={ | |
:global sendTelegramMessage; | |
:global hostStatuses; | |
:local currStatus ([/ping $host count=3] != 0); | |
:local message; | |
if ($currStatus != $hostStatuses->"$host") do={ | |
:if ($currStatus) do={ | |
:set ($message) "%F0%9F%86%99 $name is UP"; | |
} else={ |
This file contains hidden or 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
#define F_CPU 16000000 //16MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#include <stdlib.h> | |
//#include <stdio.h> | |
//#include "uart/uart.h" | |
This file contains hidden or 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
struct LedSwitch { | |
int buttonPin; | |
int ledPin; | |
int buttonState; | |
}; | |
LedSwitch ledSwitches[] = { | |
{6,2,LOW}, | |
{7,3,LOW}, | |
{8,4,LOW}, |
This file contains hidden or 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 "ds1302.h" | |
#include <avr/io.h> | |
#include <util/delay.h> | |
void ds1302_write(unsigned char cmd) | |
{ | |
DS1302_CE_DDR |= (1<<DS1302_CE_PNUM); | |
DS1302_SCLK_DDR |= (1<<DS1302_SCLK_PNUM); | |
DS1302_CE_PORT |= (1<<DS1302_CE_PNUM); |
This file contains hidden or 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
#define F_CPU 16000000 //16MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#include <stdlib.h> | |
typedef struct { | |
volatile uint8_t *port; |
This file contains hidden or 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
#define F_CPU 16000000 //16MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
#include <avr/interrupt.h> | |
#include <stdlib.h> | |
//#include <stdio.h> | |
//#include "uart/uart.h" | |
This file contains hidden or 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 "uart.h" | |
#include <avr/io.h> | |
unsigned int uart_calc_ubrr(unsigned long fosc, unsigned long baud) | |
{ | |
unsigned int ubrr; | |
unsigned long div, rem; | |
div = 16 * baud; | |
rem = fosc / div; |
This file contains hidden or 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
#define F_CPU 16000000 //16MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int ledPins[] = {PC3, PC4, PC5}; | |
int ledPinsNum = sizeof(ledPins)/sizeof(int); | |
bool pressed = false; | |
bool oldPressed = false; |
This file contains hidden or 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
#define F_CPU 1000000 //1MHz | |
#include <avr/io.h> | |
#include <util/delay.h> | |
int main(void) | |
{ | |
DDRC |= (1<<DDC5); // set LED pin PC5 to output | |
while(1) | |
{ |