diff options
author | RossTheRoss <msattr@gmail.com> | 2020-02-09 12:48:36 -0600 |
---|---|---|
committer | RossTheRoss <msattr@gmail.com> | 2020-02-09 12:48:36 -0600 |
commit | 18b29b451daa8b2b252ae615531d4af50608696e (patch) | |
tree | e41e300e8ff6a164b81d077e1cc3d04c682eccca /Lab_2B.X/lab2b_c.c | |
parent | add some c o m m e n t s (diff) | |
parent | ? (diff) | |
download | ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar.gz ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar.bz2 ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar.lz ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar.xz ee2361-18b29b451daa8b2b252ae615531d4af50608696e.tar.zst ee2361-18b29b451daa8b2b252ae615531d4af50608696e.zip |
Merge branch 'master' of https://github.com/RosstheRoss/EE2361Projects
Diffstat (limited to 'Lab_2B.X/lab2b_c.c')
-rw-r--r-- | Lab_2B.X/lab2b_c.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/Lab_2B.X/lab2b_c.c b/Lab_2B.X/lab2b_c.c index bf917a3..d2dd8e4 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,8 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- r >> 1;
+
+ r >>= 1;
++i;
}
//GREEN
@@ -56,7 +57,7 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- g >> 1;
+ g >>= 1;
--i;
}
//BLUE
@@ -66,7 +67,7 @@ void writeColor(int r, int g, int b) { } else {
write_0();
}
- b >> 1;
+ b >>= 1;
++i;
}
}
@@ -108,7 +109,6 @@ void loop(void) { // write_0();
// write_0();
// write_0();
-
writeColor(255, 155, 0);
}
-}
\ No newline at end of file +}
|