You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
738 B
C

//#include <math.h>
#include <avr/io.h>
#include <util/delay.h>
#include "arduinolib.h"
//#include "HardwareSerial.h"
void Arduinolib__dwrite_step(int p, int v, Arduinolib__dwrite_out *out){
/* set pin 5 of PORTB for output. i.e port 13 */
if (p == 13){
DDRC |= _BV(DDD7);
if (v == 0)
{
PORTD &= ~(1<<PORTD7);
//PORTB &= ~_BV(PORTB5); //put it to low
return;
}
PORTD |= (1<<PORTD7);
//PORTB |= _BV(PORTB5);
return;
}
DDRD |= _BV(DDD5);
if (v == 0)
{
PORTD &= ~(1<<PORTD5);
//PORTB &= ~_BV(PORTB4); //put it to low
return;
}
PORTD |= (1<<PORTD5);
//PORTB |= _BV(PORTB4);
return;
}