Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <popx2.h> // POP-X2 Board
- word j=0;
- void setup() {
- setTextSize(3);
- setTextColor(GLCD_YELLOW);
- glcd(1,1,"COUNT");
- setTextColor(GLCD_GREEN);
- }
- void x(){
- int i;
- for(i=50;i<140;i++){
- servo(1,i);delay(2);
- }
- j++;
- glcd(2,1,"%d ",j);
- }
- void y(){
- int i;
- for(i=140;i>50;i--){
- servo(1,i);delay(8);
- }
- }
- void loop() {
- if(analog(2)>500){
- x();delay(3000);y();delay(500);}
- }
Advertisement
Add Comment
Please, Sign In to add comment