Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include "mbed.h"
- DigitalOut gpo(PTD7);
- Serial async_port(PTA2, PTA1);
- char x, count;
- int main(){
- const int iterations = 2000;
- // double sinValues[iterations];
- // for(int i = 0; i < iterations; i++) {
- // sinValues[i] = 16*2047.0*(1+sin(2*3.142*(i/50.0)));
- // }
- async_port.baud(9600);
- int j;
- char higher, lower;
- while(1){
- for(int i = 0; i < iterations; i++) {
- j = 16*2047.0*(1+sin(2*3.142*(i/50.0)));//sinValues[i];
- higher = (j & 0xFF00) >> 8;
- lower = j & 0x00FF;
- async_port.putc(higher);
- async_port.putc(lower);
- gpo = i & 1;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement