Posts

Single fade out after button press

this first program please, gentle, goal set code once press button, glows @ full brightness, fades out after let go, test code until feel confident enough move on real project, wire arduino uno sound system of car set of led lights pulse along bass of music, plan use same basic principle code, replace button input parallel line running subwoofers electrical impulse sets off arduino lighting leds bass hits light leds , fade off smoothly, if have input on fantastic, i'll post have far, in honesty copy , paste scrap book reference section of website. right code, arduino fades continuously high low when button not pressed , glows solid when pressed, offer immensly appreciated! code: [select] const int buttonpin = 2; const int ledpin = 9; int buttonstate = 0; int led = 9; int brightness = 0; int fadeamount = 5; void setup() {   pinmode(ledpin, output);   pinmode(buttonpin, input); } void loop() {   buttonstate = digitalread(buttonpin);   if (buttonstate == ...

I really need help, [nano /ect/network/interfaces] - Raspberry Pi Forums

Image
i'm using raspberry pi nas device, want make pi have static ip address. when enter command nano /ect/network/interfaces brings me blank text file. after i've edited text file tried save , got error saying directory /ect/network/interfaces not exist. there way create file used networking interface? use help, alec picture of problem capture.jpg (18.38 kib) viewed 2981 times check spelling. should code: select all sudo nano /etc/network/interfaces raspberrypi

encoder with pid controller

i encounter following problems: 1)i need bit more precision. want count 1/2 ticks. got code here post 21. edit it, doesn't work leftencoderaset. 2)how can set value of ticks , goes in value. 3)how can find dead zone of dc motor , embed in code. code: [select] #include <digitalwritefast.h> // quadrature encoders // left encoder #define c_leftencoderinterrupt 0 #define c_leftencoderpina 2 #define c_leftencoderinterrupt 1 #define c_leftencoderpinb 3 #define leftencoderisreversed // volatile bool _leftencoderaset; volatile bool _leftencoderbset; volatile long _leftencoderticks = 0; //variables pid double setpoint=1350.0;//h timi p thelw na paei unsigned long lasttime; double errsum, lasterr; double input, output; double kp=0.009; double ki=0; double kd=0; int speedpin=5; int motorpin1=6; int motorpin2=7; //send command dc motor void loop(){ input=_leftencoderticks; compute(); if(output > 0) { cc(); } else if(output<=0){ ccw(); } serial.print(_leftencoderticks);...

Thread: Help!!!!

Image
hello need ubuntu studio 9.04. installed os , love it. when new linux makes fun day. anyways have sound , can play cd's, , dvds. dvd picture super slow. brings me help, there , drivers need download or maybe chip set? or setting need set?. ubuntu pick wireless card , installed driver not see other cards.. weird me. tried set wireless feature in network. updated change pc wireless light came on, still nothing. advice on of this? guys. install on dell inspiron 1300 forgot add that. Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [ubuntu_studio] Help!!!! Ubuntu

ADC Interrupt

what code adc interrupt? code: [select] isr(adc_vect){ ?? or can call address? code: [select] isr (0x003a) { ?? Arduino Forum > Using Arduino > Programming Questions > ADC Interrupt arduino

Should I outsource my counting to something external? Micros is too slow.

hello! i have application lot of counting involved.  i'm measuring timing of event similar of chronograph measures speed of bullet. i have 8 microsecond delay between each of these steps in code. code: [select] initmicros = micros(); nano2_data.ch1trigtime_rising = 0; while(digitalread(ch1_trig) == high && !nano2_data.trigtimeout); nano2_data.ch1trigtime_falling = (unsigned int)(micros() - initmicros); while(digitalread(ch2_trig) == low && !nano2_data.trigtimeout); nano2_data.ch2trigtime_rising = (unsigned int)(micros() - initmicros); while(digitalread(ch2_trig) == high && !nano2_data.trigtimeout); nano2_data.ch2trigtime_falling = (unsigned int)(micros() - initmicros); while(digitalread(ch3_trig) == low && !nano2_data.trigtimeout); nano2_data.ch3trigtime_rising = (unsigned int)(micros() - initmicros); while(digitalread(ch3_trig) == high && !nano2_data.trigtimeout); nano2_data.ch3t...

HC-sr04 Ultraschallsensor misst Mist

hallo, hab einen hc-sr04 ultraschallsensor ein arduino uno angeschlossen. habe das programm und die schaltung von: http://www.robodino.de/2011/12/ultraschall-distanz-sensor-hc-sr04.html verwendet. jetzt ist aber so, das der sensor immer 3cm ausgibt. wenn ich ein blatt papier zwischen die beiden sensoren halte dann wird der leseabstand verbesser, allerdings ist immer bei maximal 90cm schluss. ich wollte allerdings bis ca. 3 meter messen. habe auch schon einen anderen hc-sr04 sensor getestet, gleiches ergebnis. hat jemand eine idee?? was generelles: ich habe einen ähnlichen sensor während des studiums auf einem lego nxt verwendet. die sind hauptsächlich dafür da um festzustellen ob etwas vor dem roboter ist, aber nicht um das objekt genau zu lokalisieren (mit koordinaten). das problem bei messungen auf hoher distanz ist der schall kegelförmig ausgestrahlt wird. wenn ich es richtig in erinnerung habe waren es um die 20-30° auf jeder seite. das heißt je weite...