Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- volatile byte state = LOW;
- void setup() {
- pinMode(A1, INPUT);
- attachInterrupt(A1, blink, CHANGE);
- }
- void loop() {
- Serial.println(state);
- if (state = 1)
- {
- Serial.println("tryb 1");
- delay(500);
- }
- else
- {
- Serial.println("tryb 2");
- delay(500);
- }
- }
- void blink() {
- state = !state;
- }
Advertisement
Add Comment
Please, Sign In to add comment