Project

General

Profile

Revision 35

Simple I/O exercise 6 completed and tested (needs to be tested with a real switch)

View differences:

ex6.c
1
/*
2
 * File:   main.c
3
 * Author: root
1
/**
2
 * *****************************************************************************
3
 * @file    timers.h
4
 * @author  TP1G3
5
 * @version V1.0
6
 * @date    Sep 2014
7
 * @brief   Simple I/O exercise 6
8
 * *****************************************************************************
4 9
 *
5
 * Created on September 28, 2014, 6:32 PM
10
 *                   2014 UNIVERSIDADE DE AVEIRO
6 11
 */
7 12

  
8 13
#include <stdio.h>
......
31 36
        if (!BUTTON_RE0){            // only changes if button is goes from LOW to HIGH
32 37
            if(BUTTON_RE0){
33 38
                cycle++;
34
                for(;cycle>0;<cycle--){
39
                for(;cycle>0;cycle--){
35 40
                    for(i=0;i<6;i++){   // creates the sequence ABABABAB
36 41
                    LATB = ~LATB;
37 42
                    if (!BUTTON_RE0)            // only changes if button is goes from LOW to HIGH

Also available in: Unified diff