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
| const int led = 13; | |
| uint32_t count = 0; | |
| // Timer1 output compare A interrupt service routine | |
| ISR(TIMER1_COMPA_vect) | |
| { | |
| // Place your code here | |
| Serial.print("systick = "); | |
| Serial.println(millis()); |
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 ARRAY_SIZE 30 | |
| #define MEASURE_INVERVAL_MS 100 | |
| #define REPORT_INVERVAL_MS 5000 | |
| const int measurePin = A0; | |
| const int ledPower = 3; | |
| const int samplingTime = 280; |
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
| int enablePin = 11; | |
| int in1Pin = 10; | |
| int in2Pin = 9; | |
| boolean dir = false; | |
| int speed = 255; | |
| void setup() | |
| { | |
| pinMode(in1Pin, OUTPUT); | |
| pinMode(in2Pin, OUTPUT); |
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 <Stepper.h> | |
| const int steps = 600; | |
| // initialize the stepper library on pins 8 through 11: | |
| Stepper motor(steps, 8, 9, 10, 11); | |
| void setup() | |
| { |
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 "em_system.h" | |
| #include "em_emu.h" | |
| #include "em_cmu.h" | |
| #include "em_device.h" | |
| #include "em_chip.h" | |
| #include "em_gpio.h" | |
| #include <stdlib.h> | |
| #include <stdint.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
| /* | |
| Copyright (c) 2012-2014 RedBearLab | |
| Permission is hereby granted, free of charge, | |
| to any person obtaining a copy of this software | |
| and associated documentation files (the "Software"), | |
| to deal in the Software without restriction, | |
| including without limitation the rights | |
| to use, copy, modify, merge, publish, distribute, sublicense, |
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 <stdio.h> | |
| #include <inttypes.h> | |
| #include "em_device.h" | |
| #include "em_chip.h" | |
| #include "em_usart.h" | |
| #include "em_cmu.h" | |
| #include "em_emu.h" | |
| #include "em_adc.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
| /* | |
| Copyright (c) 2016 Ergo Inventus Inc. | |
| Copyright (c) 2012-2014 RedBearLab | |
| Permission is hereby granted, free of charge, | |
| to any person obtaining a copy of this software | |
| and associated documentation files (the "Software"), | |
| to deal in the Software without restriction, | |
| including without limitation the rights |
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 <stdio.h> | |
| #include <string.h> | |
| #include <inttypes.h> | |
| #include "em_device.h" | |
| #include "em_chip.h" | |
| #include "em_usart.h" | |
| #include "em_cmu.h" | |
| #include "em_emu.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 <avr/io.h> | |
| #include <util/delay.h> | |
| #include <avr/wdt.h> | |
| #include <avr/sleep.h> | |
| #include <avr/power.h> | |
| ISR(WDT_vect) | |
| { | |
| } |