diff options
author | RossTheRoss <msattr@gmail.com> | 2020-02-09 12:38:01 -0600 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2020-02-09 12:38:11 -0600 |
commit | 02d5204a1ae23b759888ba55c0458d1471281eae (patch) | |
tree | ae29f0318212e70eb3475fc3480920bebfd1af11 /Lab_2B.X/lab2b_c.c | |
parent | A (diff) | |
download | ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar.gz ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar.bz2 ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar.lz ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar.xz ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.tar.zst ee2361-02d5204a1ae23b759888ba55c0458d1471281eae.zip |
?
Diffstat (limited to 'Lab_2B.X/lab2b_c.c')
-rw-r--r-- | Lab_2B.X/lab2b_c.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Lab_2B.X/lab2b_c.c b/Lab_2B.X/lab2b_c.c index 893c812..4976231 100644 --- a/Lab_2B.X/lab2b_c.c +++ b/Lab_2B.X/lab2b_c.c @@ -25,7 +25,7 @@ void setup(void) { TRISB = 0x0000;
wait_100us();
}
-void writeColor(int r, int g, int b);
+void writeColor(short r, short g, short b);
void loop(void);
int main(void) {
@@ -35,8 +35,8 @@ int main(void) { return 0;
}
-void writeColor(int r, int g, int b) {
- int i = 0;
+void writeColor(short r, short g, short b) {
+ short i = 0;
LATA = 0x0000;
wait_100us();
//RED
@@ -46,7 +46,7 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- r >> 1;
+ r >>= 1;
++i;
}
//GREEN
@@ -56,7 +56,7 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- g >> 1;
+ g >>= 1;
--i;
}
//BLUE
@@ -66,7 +66,7 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- b >> 1;
+ b >>= 1;
++i;
}
}
@@ -108,7 +108,7 @@ void loop(void) { // write_0();
// write_0();
// write_0();
-
+//
writeColor(255, 155, 0);
}
}
|