hello, first post asking in forum patient if dont correctly well, im trying make robot evades obstacles , uses interrupts in order distances. ive used flexitimer2 run void function each 5ms, problem whe try verify program says me there error in use of flexitimer. code: [select] flexitimer2::set(1, 1.0/1000, rastreodistanciamin()); i copy code below, please can tell error , how solve it, ive been loking dont know do. thank you code: [select] #include <flexitimer2.h> #include <servo.h> //motor a int ena = 7; int in1=6; int in2 = 5; //motor b int in3=11; int in4=10; int enb=9; servo cabeza; //hc-sr04 device int echo = 13; int triger = 12; //it use hc-sr04 determine , return distance in front of him int calculodistancia(){ volatile int tiempo; volatile int distancia; digitalwrite(triger,low); /* por cuestión de estabilización del sensor*/ delaymicroseconds(5); digitalwrite(triger, high); /* envío del pulso ultrasónico*/ delaymicroseconds(10); tiem
i downloaded code. here have several single leds flashing music microphone. in project, instead of single rgb leds, have 5 rgb led strips. need change in code? led strip 10m supernight rgb strip cut 5 equal strips. // arduino pin numbers const int do_pin = 2; const int ao_pin = 0; int sound; int led1 = 8; int led2 = 9; int led3 = 10; int led4 = 11; int led5 = 12; void setup() { pinmode(do_pin, input); pinmode(led1, output); pinmode(led2, output); pinmode(led3, output); pinmode(led4, output); pinmode(led5, output); serial.begin(9600); } void loop() { if (sound > 31) { digitalwrite(led1, high); } if (sound < 31) { digitalwrite(led1, low); } if (sound > 35) { digitalwrite(led2, high); } if (sound < 35) { digitalwrite(led2, low); } if (sound > 40) { digitalwrite(led3, high); } if (sound < 40) { digitalwrite(led3, low); } if (sound > 45) { digitalwrite(led4, high); } if
Comments
Post a Comment