Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <reg51.h>
- int x_fixed;
- unsigned char xdata y[100], i;
- unsigned int f(unsigned int x) {
- unsigned int S = 0x0f;
- S = 0xf0+((x*S)>>8);
- S = 0xf0+((x*S)>>8);
- S = 0xf0+((x*S)>>8);
- S = 0xf0-((x*S)>>8);
- return S;
- }
- main()
- {
- i = 0;
- for (x_fixed = 99; x_fixed >= 0; --x_fixed)
- y[i++] = f(x_fixed);
- while(1)
- {
- i = 0;
- for (x_fixed = 0; x_fixed <= 99; ++x_fixed)
- {
- f(x_fixed);
- P1 = y[i++];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement