#define LED 8 #define SW 7 void setup() { pinMode(LED, OUTPUT); pinMode(SW, INPUT); } void loop() { digitalWrite(LED, HIGH); delay(1000); digitalWrite(LED, LOW); delay(1000); }
#define LED 8 #define SW 7 void setup() { pinMode(LED, OUTPUT); pinMode(SW, INPUT_PULLUP); } void loop() { if(gigitalRead(SW_==0) { digitalWrite(LED, HIGH); } else { digitalWrite(LED, LOW); } }
void setup()
{
pinMode(PA1,OUTPUT);
}
void loop()
{
digitalWrite(PA1,HIGH);
digitalWrite(PA1,LOW);
}
#define F_CPU 20000000UL
#include
int main(void)
{
DDRA |= (1<<1);
while(1)
{
PORTA |=(1<<1);
PORTA &=~(1<<1);
}
}
.org 0
sbi DDRA,1
main:
sbi PORTA,1
cbi PORTA,1
RJMP main