Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

final handout, fixes to 2-2-blinky_no_delay

  • Loading branch information...
commit 5a96efc995a70837e0c4476ee9a2b2f3b10eeca1 1 parent d36f681
@mikepea authored
View
BIN  docs/Workshop Handout.odt
Binary file not shown
View
25 ...es/session2-blinky/blinky_without_delay.c → examples/2-2-blinky_no_delay.c
@@ -6,35 +6,14 @@
*/
#include <avr/io.h>
+#include "common.h"
#include "badge.h"
unsigned int loop_counter = 0;
unsigned int second_counter = 0;
-void delay_ten_us(unsigned int us) {
- unsigned int count;
-
- while (us != 0) {
- for (count=0; count <= 8; count++) {
- PINB |= bogusMask;
- }
- us--;
- }
-}
-
void pre_loop_setup() {
- // zero our timer controls, for now
- TCCR0A = 0;
- TCCR0B = 0;
- TCCR1 = 0;
- GTCCR = 0;
-
- DDRB = (rgbMask) | ( irOutMask );
-
- // all PORTB output pins High (all LEDs off), except for the
- // IR LED, which is SOURCE not SINK
- PORTB = ( 0xFF & ~irOutMask );
-
+ initialise_registers();
}
int main(void) {
Please sign in to comment.
Something went wrong with that request. Please try again.