Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <ATX2.h>
- #define SV4_OPEN_ANGLE 165
- #define SV4_CLOSE_ANGLE 85
- void setup(){
- OK();
- glcdClear();
- glcdMode(1);
- setTextSize(2);
- glcd(1,3,"Gripper");
- glcd(2,1,"Switch Test");
- setTextSize(4);
- }
- void loop(){
- if(in(28) == 0 && in(29) == 1)
- {
- servo(4, SV4_OPEN_ANGLE);
- setTextColor(GLCD_GREEN);
- glcd(2,1,"OPEN ");
- }
- else if(in(28) == 1 && in(29) == 0)
- {
- servo(4, SV4_CLOSE_ANGLE);
- setTextColor(GLCD_RED);
- glcd(2,1,"CLOSE");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement