Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <popxt.h>
- int CL=300,CR=300,x=0,i;
- void setup(){
- digitalWrite(13,1);
- pinMode(13,INPUT_PULLUP);
- sound(1000,200);
- while(digitalRead(13));
- for(i=0;i<5;i++){
- sound(500*i+1,100);
- delay(900);
- }
- }
- void loop(){
- sl(50);
- if(analog(0)>CL){
- bk(100);delay(300);
- sr(60);delay(800);
- x=0;
- }
- else if(analog(6)>CR){
- bk(100);delay(500);
- sl(60);delay(900);
- x=0;
- }
- else if(analog(2)>65){
- if (x>100){
- x=0;
- bk(100);sound(300,100);delay(200);
- sl(100);delay(20);
- }
- else{
- x++;
- fd(100);delay(100);
- }
- }
- }
- /*void setup(){
- setTextSize(3);
- }
- void loop(){
- glcd(0,0,"L=%d ",analog(0));
- glcd(1,0,"R=%d ",analog(6));
- glcd(2,0,"G=%d ",analog(2));
- delay(200);
- }*/
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement