Hallo
Ich bin noch ziemlich neu auf dem Gebiet der µC. Deshalb habe ich eine
Frage warum mein Programm nicht funktioniert.
Ich will mit einem Taster eine LED zum Leuchten bringen.
Ich habe den dsPIC33FJ256MC710A, den CCS PCD Compiler, MPLAB X IDE und
das dsPICDEM MCLV Board.
//E1 ist die LED und D7 ist der Schalter
Hier das Programm:
1 | #include <33FJ256MC710A.h>
|
2 | #include <stdio.h>
|
3 | #include <stdlib.h>
|
4 |
|
5 | void (main)
|
6 | {
|
7 | set_tris_E(0);
|
8 | set_tris_D(1);
|
9 |
|
10 | if (input(PIN_D7)==1)
|
11 | {
|
12 | output_high(PIN_E1);
|
13 | }
|
14 | else
|
15 | {
|
16 | output_low(PIN_E1);
|
17 | }
|
18 | }
|
mfg