Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*****************************************
- * CMPS11 Serial example for Arduino *
- * Fork from James Henderson, 2014 *
- *****************************************/
- #include <popx2.h>
- unsigned char H,L;
- unsigned int angle;
- void setup(){
- setTextSize(2);glcdMode(3);
- glcd(3,0,"CMPS11");
- }
- void loop(){
- uart1_putc(0x13);
- while(uart1_available() < 2);
- H = uart1_getkey();L = uart1_getkey();
- angle=(H<<8)+L;
- glcd(0,0,"Angle=%d.%d ",angle/10,angle%10);
- }
Advertisement
Add Comment
Please, Sign In to add comment