code? Answered

Heres the code for flashing SOS in morse code on output pin 4 with a piAxe microcontroller so please verify the code if there are some mistakes that i made plzzz help me out. main: high 4 pause 1000 low 4 pause 1000 high 4 pause 1000 low 4 pause 1000 high 4 pause 1000 low 4 pause 1000 high 4 pause 3000 low 4 pause 1000 high 4 pause 3000 low 4 pause 1000 high 4 pause 3000 low 4 pause 1000 high 4 pause 2000 low 4 pause 1000 high 4 pause 1000 low 4 pause 1000 high 4 pause 1000 low 4 pause 1000 high 4 pause 1000 low 4 pause 1000

Asked by robot1398 7 years ago  |  last reply 7 years ago


Code blocks not respecting code

So, I got some feedback that my 'ible has some errors in it (which is somewhat expected :D )  I went to the instructable, to do some editing and noticed that the problems are likely coming from and tags that are in the code blocks. I tried to remove them, but they come back when I save.  I noticed this happens in *all* my code blocks.  Changing the format of text in code blocks makes Instructables unacceptable as a way to share code. Considering the amount of code for many projects on this site, this potentially breaks many of them, or at the very least makes it harder for others to copy the code for their projects.   Please make tags repect all formatting within!  Thanks, JR

Posted by jack ruby 2 years ago  |  last reply 1 year ago


Batch Coding

I need an interactive advanced batch and visual basic scripts course.

Posted by DarkShadowOrigin 1 year ago  |  last reply 1 year ago


Premium Code

I received a code for a premium Teacher membership.  I have entered the code and logged in, but when I go to download it says I need to upgrade to premium.  Help!

Posted by Zilhaver01 1 year ago  |  last reply 1 year ago


Promo code

Ok so I have 3 instructables featured now,yeah , I was given promo code for each but have lost one of the codes, is there anyway of retrieving it? Thanks.

Posted by LarryF29 1 year ago  |  last reply 1 year ago


Script Codes

Is it possible to get a list of all script codes? Thank you.

Posted by ChelEddy 12 years ago  |  last reply 12 years ago


Coding question Answered

In this line of code the N and Y have single quotation marks around them, what do they do?  if (goodOne == 'N' && buttonPushed == 'Y')

Asked by WWC 6 years ago  |  last reply 6 years ago


Code for website

Which programming language is good for making websites like https://errorcode0x.com/resolve-steam-error-code-80/ ?? Please suggest me.

Posted by zikkij 7 weeks ago  |  last reply 6 weeks ago


Itune codes?

This may be stupid but... Anyone have itune card that can give me the code? If you do I will sub 5 all of your ibles fave all of your ibles or anything else you want. thank you

Posted by smilee 9 years ago  |  last reply 9 years ago


QR Codes

Hey, I just found out about QR Codes and stuff and it's pretty cool, and I've been searching google for a while now, but does anybody know if there's software for the samsung u740 that can decode it (it's the phone that flips both ways).

Posted by guyfrom7up 10 years ago


de-code this

Try to decode this,there is one word here: thcnedrcrpoac

Posted by iproberry1 7 years ago  |  last reply 7 years ago


Source Code

Hi, Its fantastic to be able to read peoples source code on an instructable. However if its long, its a bit difficult to read. Can you please give the option when making an instructable, to display certain text as syntax, like in forums etc.

Posted by HMBeck 7 years ago


PICAXE Code? Answered

I am not able to understand why is FOR loop used for the irout command can someone please tell me. Another ques can I use the serout pin for the IRout command Heres the Code: for b1 = 1 to 10    irout B.1,1,5    pause 45 next b1

Asked by Bot1398 6 years ago  |  last reply 6 years ago


Arduino coding

May i know how to combine between 2 coding of arduino ? I use 2 sensor so i need to combine these 2 coding but i don't know how . . Does any body can help me ?i really appreciate for this help.. You can contact me via gmail : nashihanorhata@gmail.com

Asked by nash shiha 1 year ago


Arduino Code?

I have a simple problem that I could not solve for days. I am trying to write a code that takes an input from Serial Communication port such as: "00aaaaaaa12dddddddd23vvvvvvvvvvvv" and divides into one string matrix and one array such as String[] = {"aaaaaaa","dddddddd","vvvvvvvvvvvv"} int Array[] = {0,12,23} //2-digit int numbers Thank you for you help

Asked by giray123 6 years ago  |  last reply 6 years ago


Arduino Code?

I would like to understand this piece of Arduino code.             " delay(300L * 1000L); // 5 minutes. This can be changed to change increments " This is supposed to be a 5 min time period. 1000 = 1 second. 60 sec per min. 300 sec / 60.   Calculates by 300 / 60 = 5 minutes. What is the  " L " supposed to do? What does it represent?

Asked by WWC 6 years ago  |  last reply 6 years ago


HEX code?

Heres the asm file that i was trying to convert into HEX file but i was getting many errors by this software MPLAB IDE  Heres the asm file  https://www.instructables.com/id/3x3x3-LED-Cube/step2/The-software/  the code is in the zip file

Asked by robot1398 7 years ago  |  last reply 7 years ago


picaxe code? Answered

Sorry Rickharis for again asking a picaxe question but here it is. give me a simple program to make a simple dice with a picaxe

Asked by robot1398 7 years ago  |  last reply 7 years ago


Electrical in code?

Hi, I came up with a new way of doing lighting and would like to post it as an Instructable. There's only a slight modification of existing components and standard electrical hardware is used, but I'm concerned I may be called out for possible electrical code violations. Are these checked by the Instructables crew or every project is treated with a warning that anyone using each project needs to be aware of electrical code issues? Thanks.

Asked by aeyring 4 years ago  |  last reply 4 years ago


compiling code?

I have written several scripts and simple games in python 2.7.2, and would like to give them to friends so they can play them. however, they do not have python, and therefore cant run it, so I need to compile the code. the only problem is, i cant figure out how or to compile it or to get any compiler to work. any help would be appreciated! thanks,            iloveairsoftstuff

Asked by the mechanical engineer 7 years ago


vbs codes

Hi ...i am still learning  codes was trying to convert this bat codes to  vbs codes but i don't know how. can any one help me? this is the example of the bat codes, i really need your help. Thanks bro..: @echo off echo Hi guy, what do you want to open? set/p "cho=>" if %cho%==facebook start facebook.bat if %cho%==yahoomail start YahooMail.bat if %cho%==youtube start youtube.bat if %cho%==blackboard start blackboard.bat if %cho%==porno start porno.bat if %cho%==hacking start hacking.bat if %cho%==gmail start gmail.bat

Asked by diki83 9 years ago


will this code work? Answered

Q1-here is the code for picaxe 08m2 will it work or something is wrong Q2-to repeat a code what value do i have to give for the FOR loop i have assumed it to be 0 to 0 THE CODE--------- main: if pinc.4 = 1 then main2       if pinc.0 = 1 then main3       if pinc.1 = 1 then main4       goto main       main2:for b0 = 0 to 0       play 2,0       next b0       pause 2000       goto main       main3:for b0 = 0 to 0       play 2,1       next b0       pause 2000       goto main            main4:for b0 = 0 to 0       play 2,3       next b0       pause 2000       goto main

Asked by e=mc^2 7 years ago  |  last reply 7 years ago


Arduino codes

Good evening Sir, Madam, I am currently attempting to build a circuit for a college module that would use vibration data from a dc motor then send it to a microprocessor before transferring the data via Bluetooth to a pc. I have trawled through numerous sites for the correct components to use but. My question is this. Is there a Arduino code that would enable this idea to be successful? Having never written a code I am somewhat stumped and stressed out to the max. I would be grateful of any help or advice you can offer, Thank you in advance for your time over this, Best regards Mark sheldon

Posted by Shaggy74 1 year ago  |  last reply 1 year ago


Code writting?

I'm trying to build a line follower robot and I don't know the first thing about writing code.  I like to play with electronics but have never attempted building anything that requiered programing so I thought I would start simple.  I have an Arduino Uno R3, Pololu QTR-8 (only using 6 of the sensors) and an Ardumoto Motor Shield based on L298 H-bridge logic (not even sure what that means) Are there examples of codes existing on how to connect three componetns together?  What do I need to do next in order to connect these three parts and imput a code so it will smothly follow back tape on a white surface?

Asked by bowhunter616 6 years ago  |  last reply 6 years ago


Arduino Code?? Answered

I have created a code for the arduino breathalyzer and I wat to confirm that will it work properly so please someone who's good with this can do this for me.And yes the code compiles successfully but will it work as expexted.It should light up some of the 7 LEDs according to how much you drink.It also has a pot to calibrate the sensor and i will be using a MQ-3 alcohol sensor. here is the code: const int analogPin = 0;    // the pin that the potentiometer is attached to const int ledCount = 7;    // the number of LEDs in the bar graph int ledPins[] = { 7,6,5,4,3,2,1 // Here we have the number of LEDs to use in the BarGraph   };   void setup() {   for (int thisLed = 0; thisLed < ledCount; thisLed++) {     pinMode(ledPins[thisLed], OUTPUT);   }} void loop() {   //This is the code to light up LED's   int sensorReading = analogRead(analogPin);   int ledLevel = map(sensorReading, 500, 1023, 0, ledCount);   for (int thisLed = 0; thisLed < ledCount; thisLed++) {     if (thisLed < ledLevel) {       digitalWrite(ledPins[thisLed], HIGH);     }     else {       digitalWrite(ledPins[thisLed], LOW);     }  }}

Asked by Bot1398 7 years ago  |  last reply 7 years ago


help with code

Hi , i have made a robot using arduino uno with aservo to move the ir sensor and two motors using l293....but i need a program for it ... so please help me.....

Asked by kiran890 6 years ago  |  last reply 6 years ago


arduino code

Guys I want to build a quadcopter. I have an arduino uno, adafruit motor shield, 4dc motors and an rf link transmitter/receiver. Problem is I don't know programming at all. Pls help me and give me a code for controlling the motors with the sheild wirelessly withb rflink. Planning to control with 4 potentiometers. P.S I have only one arduino.

Posted by fahmed20 4 years ago  |  last reply 4 years ago


Pokesav Codes

Hey PKMN Fans im making Pokesav codes for pokemon Diamond and pearl and wanted to now If any one wanted some codes. All you have to do is make sure you have a DS action replay and Either diamond or pearl then tell me all the characteristics you want your pokemon to have. Then I will make it then post the code in the comments for you and others to use. These codes will not work for the GBA games. Here is the code for my ultimate Rayquaza. Diamond: 94000130 FCFF0000 B21C4D28 00000000 B0000004 00000000 E0000304 000000EC 53332F06 3D060000 39DECAD6 8E8EEBFB 5A75143F 27060332 B3A20E5A 518B6AF6 9C01C887 C49482B9 E9675111 B1E6F764 BD7D0CC0 2E4CDDB8 AB511D8E E9CF6DAF 721BF23A 5B20D6EB 85D77B29 485D4BE9 CF072415 C79DC84A 66728577 F0CB878C 10F579FB 071844B7 E8279DEF 7B2D55A8 5DEEA3E6 25C69A8E 5BE816A2 C4EDBB6F F5ABA2A1 978C187B 2192E9C3 C969B273 8C5FD893 2A7F45A5 FC9A788D 5E95FF0F F6947A37 723FCA58 AC83F121 570FDBFC F5865A15 68BE28F2 F7B312DB 60097FA1 0E5EDF8B BEB4D16F 7FBD203F F7D28197 E8CFAE0A D842CD40 837A9328 F37CA0CA AAF31276 188D6E6A 4262B224 00000000 D2000000 00000000 Pearl: 94000130 FCFF0000 B21C4D28 00000000 B0000004 00000000 E0000304 000000EC 53332F06 3D060000 39DECAD6 8E8EEBFB 5A75143F 27060332 B3A20E5A 518B6AF6 9C01C887 C49482B9 E9675111 B1E6F764 BD7D0CC0 2E4CDDB8 AB511D8E E9CF6DAF 721BF23A 5B20D6EB 85D77B29 485D4BE9 CF072415 C79DC84A 66728577 F0CB878C 10F579FB 071844B7 E8279DEF 7B2D55A8 5DEEA3E6 25C69A8E 5BE816A2 C4EDBB6F F5ABA2A1 978C187B 2192E9C3 C969B273 8C5FD893 2A7F45A5 FC9A788D 5E95FF0F F6947A37 723FCA58 AC83F121 570FDBFC F5865A15 68BE28F2 F7B312DB 60097FA1 0E5EDF8B BEB4D16F 7FBD203F F7D28197 E8CFAE0A D842CD40 837A9328 F37CA0CA AAF31276 188D6E6A 4262B224 00000000 D2000000 00000000

Posted by GTRPLR1995 10 years ago  |  last reply 5 years ago


Arduino Code? Answered

Int redPin = 9; int greenPin = 10; int bluePin = 11; int buzzerPin = 7; int potPin = 1; int sensorPin = 0; long red = 0xFF0000; long green = 0x00FF00; long blue = 0x000080; int band = 10; // adjust for sensitivity void setup() {   pinMode(potPin, INPUT);   pinMode(sensorPin, INPUT);   pinMode(redPin, OUTPUT);   pinMode(greenPin, OUTPUT);   pinMode(bluePin, OUTPUT);   pinMode(buzzerPin, OUTPUT); } void loop() {     int gsr = analogRead(sensorPin);     int pot = analogRead(potPin);     if (gsr > pot + band)     {         setColor(red);         beep();     }     else if (gsr > 16;     int green = (rgb >> 8) & 0xFF;     int blue = rgb & 0xFF;     analogWrite(redPin, red);     analogWrite(greenPin, green);     analogWrite(bluePin, blue); } void beep() {     for (int i=0; i<1000; i++)     {         digitalWrite(buzzerPin, HIGH);         delayMicroseconds(100);         digitalWrite(buzzerPin, LOW);         delayMicroseconds(100);     } } The code does not compile properliy it says steColour was not defined in the scope.Its a lie detector code.

Asked by oallaa 6 years ago  |  last reply 6 years ago


Arduino code Answered

Hello, I have been trying to make code for my arduino. I would like code to tell my arduino to receive a servo signal from my rc receiver, then detect whether the signal is telling the esc to move forwards or backwards. If the signal is forwards, it simply relays that code to the ESC. If the signal tells the ESC to go backwards, then it sends a signal to go forwards at the speed it would have gone in reverse, while sending out a power source to power a relay. Chowmix12 came up with some code that may help and I put  "//" before all of the code that was not needed for his application to work. Also, this link may be helpful for multitasking.  #include Servo ThrottleServo; //int PWMpin = 2; // connect RC receiver here. //int ServoVal; //int RCinput; void setup() { //Serial.begin(9600); //ThrottleServo.attach(9); // attaches the servo on pin 9 to the servo object //ThrottleServo.write(97); // go to nuetral pinMode(13, OUTPUT); } void loop() { //RCinput = pulseIn(PWMpin, HIGH, 20000); //ServoVal = map(RCinput, 520, 2370, 0, 180); //if(RCinput== 0) { // Signal timed out! digitalWrite(13, HIGH); // ALERT! ThrottleServo.write(97); // Go to neutral throttle position } //else{ // digitalWrite(13, LOW); // everything's fine. // ThrottleServo.write(ServoVal); // Repeat the data to the truck's ESC // Serial.print(" PulseMicros "); // This part is used to debug the values for calibration // Serial.print(RCinput); //Serial.print(" ServoRead "); // Serial.println(ServoVal); // } //} My program so far is as follows. /* created 2005 by David A. Mellis and chowmix12 modified by Justin Baker */ #include const int relay =  10; Servo ThrottleServo; int ServoVal; int RCinput; int PWMpin=2; int relayState = LOW;       long previousMillis = 0;    long interval = 1000;          void setup() {   pinMode(relay, OUTPUT);  Serial.begin(9600); pinMode(9, OUTPUT);  } void loop() { RCinput = pulseIn(PWMpin, HIGH, 20000); ServoVal = map(RCinput, 520, 2370, 0, 180); if(ServoVal>90) { digitalWrite(9, HIGH); ThrottleServo.write(ServoVal); } else{ ServoVal=180-ServoVal; digitalWrite(9, HIGH); ThrottleServo.write(ServoVal); }   unsigned long currentMillis = millis();   if(currentMillis - previousMillis > interval) {        previousMillis = currentMillis;       if (ServoVal >= 90)       relayState = LOW;     else       relayState = HIGH; //this output will turn a mosfet off, turning the relay off       digitalWrite(relay, relayState);   } }

Asked by jbaker22 4 years ago  |  last reply 4 years ago


verilog code ?

I have made sample code for 4 bit ALU and 3 to 8 decoder to make 4 bit processor . as designer we can design anything so I have started to design processor with two function ALU and decoder 4 bit alu Module alu (a,b,s0,s1,s2 f); Input a,b,s0,s1,s2; Output f; Reg [3:0]; Always @(s0,s1,s2); Begian Case (s0,s1,s2); 3b’000 :f=(a&b;); 3b’001:f= (a|b); 3b’010 :f= ~(a&b;); 3b’011 :f= ~ (a|b); 3b’100:f=(a^b); 3b’101: f=(a*b); 3b’110: f=(a+b); 3b’111:f=(a-b ); End case End module 3to 8 decoder Module decoder (a2,a1,a0, d7,d6,d5,d4,d3,d2,d1,d0); Input a2,a1,a0; Output d7,d6,d5,d4,d3,d2,d1,d0; Wire [7:0]; Always @(a2,a1,a0); Begin Case (a2,a1,a0); 4’b000:( d7,d6,d5,d4,d3,d2,d1,d0)=00000001; 4’001: (d7,d6,d5,d4,d3,d2,d1,d0)=00000010; 4’b010: (d7,d6,d5,d4,d3,d2,d1,d0)=00000100; 4’b011: (d7,d6,d5,d4,d3,d2,d1,d0)=00001000; 4’b100:( d7,d6,d5,d4,d3,d2,d1,d0)=00010000; 4’b101:( d7,d6,d5,d4,d3,d2,d1,d0)=00100000; 4’b110: (d7,d6,d5,d4,d3,d2,d1,d0)=01000000; 4’b111: (d7,d6,d5,d4,d3,d2,d1,d0)=10000000; Endcase Endmodule I don't understand how to connect 4 bit Alu with     3 to 8 bit decoder to make 4 bit processor    

Asked by vead 4 years ago  |  last reply 4 years ago


Coding problems for Arduino...?

I am trying to set up an accelerometer with 3 LED lights that light up dependent on the Y axis reading... the following code I have but I am getting error messages relating to the "{" on some of my lines of code. Please please could someone enlighten me on whats going wrong or even if I have the right code! /*  ADXL3xx    Reads an Analog Devices ADXL3xx accelerometer and communicates the  acceleration to the computer.  The pins used are designed to be easily  compatible with the breakout boards from Sparkfun, available from:  http://www.sparkfun.com/commerce/categories.php?c=80   http://www.arduino.cc/en/Tutorial/ADXL3xx   The circuit:  analog 0: accelerometer self test  analog 1: z-axis  analog 2: y-axis  analog 3: x-axis  nalog 4: ground  analog 5: vcc    created 2 Jul 2008  by David A. Mellis  modified 4 Sep 2010  by Tom Igoe   modified 21 Dec 2010    This example code is in the public domain. */ // these constants describe the pins. They won't change: const int groundpin = 18;             // analog input pin 18 -- ground const int powerpin = 19;              // analog input pin 19 -- voltage const int xpin = A3;                  // x-axis of the accelerometer const int ypin = A2;                  // y-axis const int zpin = A1;                  // z-axis (only on 3-axis models)  void setup() const int ledPINKPin =  9;      // the number of the LED pin const int ledBLUEPin = 10; const int ledGREENPin = 11; const int ypin = A2;                  // y-axis {                                // initialize the serial communications:  Serial.begin(9600);                   // bluetooth baud rate     pinMode(groundpin, OUTPUT);   pinMode(powerpin, OUTPUT);   digitalWrite(groundpin, LOW);    digitalWrite(powerpin, HIGH);     // print the sensor values:   //Serial.print("ypin: ");   Serial.print(analogRead(ypin));  // print a tab between values:   Serial.print("\t");   //Serial.print("ypin: ");   // delay before next reading:   delay(2000); } if (analogRead(ypin) > 1000 then       // turn LED on:        digitalWrite(ledPINKPin, HIGH);    else {     // turn LED off:     digitalWrite(ledPINKPin, LOW); { if (analogRead(ypin) > 600 then       // turn LED on:        digitalWrite(ledGREENPin, HIGH);    }   else {     // turn LED off:     digitalWrite(ledGREENPin, LOW);     if (analogRead(ypin) > 40 then       // turn LED on:        digitalWrite(ledBLUEPin, HIGH);    }   else {     // turn LED off:     digitalWrite(ledBLUEPin, LOW);

Asked by lucystanger 6 years ago  |  last reply 6 years ago


Help with Arduino Coding

Hello. I have recently been interested in coding Arduino and the USAF lets me to launchpads to setup remote cameras that are sound activated for a rocket launch. I was working on designing an Arduino connected to one of the cheap sound detector modules on eBay. The camera would be triggered by a short circuit on the digital end, with the sound module on the analog end. The camera is activated by a short circuit on the shutter release, so I though I would have + going into the camera when sound is activated with the other cables on ground. I just needed someone to check over my coding, as I am debating whether or not to buy an Arduino. No errors appeared on the computer, so I don't know if it will work fine or not                                                                                                                                                                                                                void setup() {}   //Just there as placeholder: void loop()    //To repeat a function of detecting sound: {const int SoundDetectorPin = A2;  //Sound Detector Module located at Analog pin 2:   const int CameraTriggerOutput = 3;  //Dual Trigger Output is located at Digital pin 3: //Following is If functions: if (analogRead(SoundDetectorPin) == LOW) //When power is read, if it is LOW, the trigger detected sound:      digitalWrite(CameraTriggerOutput, HIGH); //Pin 3 is given positive voltage: else {  //If opposite happens:     digitalWrite(CameraTriggerOutput, LOW); //When power is read, if it is HIGH, the trigger is detected nothing and no command is excecuted:    } }                                                                                                                                

Posted by SpaceShuttleFan 4 years ago  |  last reply 3 years ago


Arduino Code for LEDs

I am trying to get it to work so one button turns on and off the lights and then another button that switches one set of lights on then when pressed turns those off and puts on another set on. Basically one set of yellow lights on then when the button is pressed they turn off and the red lights go on.

Asked by AlexH155 2 years ago  |  last reply 2 years ago


Arduino Coding help? Answered

I need some guidance on how to write some Arduino code. The physical side is an Arduino mega ADK connected to some buttons and leds. On the code side, I modified the button sketch. I am stuck on how to add multiple buttons. in the void loop. I just need someont to show me how to add 1 after that i can figure out how to add the rest. Thanks,  Kaden const int button1 = 24;     // the number of the pushbutton pin const int button2 = 25; const int button3 = 26; const int button4 = 27; const int button5 = 28; const int Bucket1 = 2; const int Bucket2 = 3; const int Bucket3 = 4; const int Bucket4 = 5; const int Bucket5 = 6; const int Bucket6 = 7; const int Bucket7 = 8; const int Bucket8 = 9; const int Bucket9 = 10; const int Bucket10 = 11; const int Bucket11 = 12; const int Bucket12 = 13; int buttonState1 = 0;         // variable for reading the pushbutton status int buttonState2 = 0; int buttonState3 = 0; int buttonState4 = 0; int buttonState5 = 0; void setup() {   // initialize the LED pin as an output:   pinMode(Bucket1, OUTPUT);   // declare LED strip pin as output   pinMode(Bucket2, OUTPUT);   pinMode(Bucket3, OUTPUT);   pinMode(Bucket4, OUTPUT);   pinMode(Bucket5, OUTPUT);   pinMode(Bucket6, OUTPUT);   pinMode(Bucket7, OUTPUT);   pinMode(Bucket8, OUTPUT);   pinMode(Bucket9, OUTPUT);   pinMode(Bucket10, OUTPUT);   pinMode(Bucket11, OUTPUT);   pinMode(Bucket12, OUTPUT);   // initialize the pushbutton pin as an input:   pinMode(button1, INPUT);   pinMode(button2, INPUT);   pinMode(button3, INPUT);   pinMode(button4, INPUT);   pinMode(button5, INPUT); } void loop() {     buttonState1 = digitalRead(button1);   buttonState2 = digitalRead(button2);   buttonState3 = digitalRead(button3);   buttonState4 = digitalRead(button4);   buttonState5 = digitalRead(button5);   // check if the pushbutton is pressed.   // if it is, the buttonState is HIGH:   if (buttonState1 == HIGH) {     // turn LED on:   digitalWrite(Bucket1, HIGH);  // turn LED strip on when button is pressed   digitalWrite(Bucket2, HIGH);   digitalWrite(Bucket3, HIGH);   digitalWrite(Bucket4, HIGH);   digitalWrite(Bucket5, HIGH);   digitalWrite(Bucket6, HIGH);   digitalWrite(Bucket7, HIGH);   digitalWrite(Bucket8, HIGH);   digitalWrite(Bucket9, HIGH);   digitalWrite(Bucket10, HIGH);   digitalWrite(Bucket11, HIGH);   digitalWrite(Bucket12, HIGH);   }   else {     // turn LED off:   digitalWrite(Bucket1, LOW);  // turn LED strip on when button is pressed   digitalWrite(Bucket2, LOW);   digitalWrite(Bucket3, LOW);   digitalWrite(Bucket4, LOW);   digitalWrite(Bucket5, LOW);   digitalWrite(Bucket6, LOW);   digitalWrite(Bucket7, LOW);   digitalWrite(Bucket8, LOW);   digitalWrite(Bucket9, LOW);   digitalWrite(Bucket10, LOW);   digitalWrite(Bucket11, LOW);   digitalWrite(Bucket12, LOW);   } }

Asked by FarmerKJS 3 years ago  |  last reply 3 years ago


help with arduino code? Answered

I am making a project for my 6 DOF arm and I want to control the arm with a remote. I found a code for just that, but with only one servo and I am hoping somebody can help me out with changing the code to control 6 servos. please help me!!! the code is shown below. #include #include   // You will have to set these values depending on the protocol // and remote codes that you are using. These are from my Sony DVD/VCR #define MY_PROTOCOL NEC #define RIGHT_ARROW   0xffc23d //Move several clockwise #define LEFT_ARROW    0xff22dd //Move servo counterclockwise #define OK_BUTTON     0xff02fd //Center the servo #define UP_ARROW      0xff629d //Increased number of degrees servo moves #define DOWN_ARROW    0xffa857 //Decrease number of degrees servo moves #define BUTTON_0      0xff4ab5  //Pushing buttons 0-9 moves to fix positions #define BUTTON_1      0xff6897  // each 20 degrees greater #define BUTTON_2      0xff9867 #define BUTTON_3      0xffb04f #define BUTTON_4      0xff30cf #define BUTTON_5      0xff18e7 #define BUTTON_6      0xff7a85 #define BUTTON_7      0xff10ef #define BUTTON_8      0xff38c7 #define BUTTON_9      0xff5aa5   IRrecv My_Receiver(11);//Receive on pin 11 IRdecode My_Decoder;  Servo My_Servo;  // create servo object to control a servo  int pos;         // variable to store the servo position  int Speed;       // Number of degrees to move each time a left/right button is pressed void setup()  {   My_Servo.attach(9);  // attaches the servo on pin 9 to the servo object    pos = 90;            // start at midpoint 90 degrees   Speed = 3;           //servo moves 3 degrees each time left/right is pushed   My_Servo.write(pos); // Set initial position   My_Receiver.enableIRIn(); // Start the receiver }    void loop()  {      if (My_Receiver.GetResults(&My;_Decoder)) {        My_Decoder.decode();        if(My_Decoder.decode_type==MY_PROTOCOL) {           switch(My_Decoder.value) {             case LEFT_ARROW:    pos=min(180,pos+Speed); break;             case RIGHT_ARROW:   pos=max(0,pos-Speed); break;             case OK_BUTTON: pos=90; break;             case UP_ARROW:      Speed=min(10, Speed+1); break;             case DOWN_ARROW:    Speed=max(1, Speed-1); break;             case BUTTON_0:      pos=0*20; break;             case BUTTON_1:      pos=1*20; break;             case BUTTON_2:      pos=2*20; break;             case BUTTON_3:      pos=3*20; break;             case BUTTON_4:      pos=4*20; break;             case BUTTON_5:      pos=5*20; break;             case BUTTON_6:      pos=6*20; break;             case BUTTON_7:      pos=7*20; break;             case BUTTON_8:      pos=8*20; break;             case BUTTON_9:      pos=9*20; break;           }         My_Servo.write(pos); // tell servo to go to position in variable 'pos'        }      My_Receiver.resume();     } }

Asked by ibenkos 3 years ago  |  last reply 3 years ago


Secret code program?

does any body have A secret code encoder/decoder written in basic

Asked by neeley 8 years ago  |  last reply 8 years ago


FIRST CODE LANGUAGE????

Hey, I know not a bit of code whats the best first language for a beginner thx -zombeastly

Asked by zombeastly 7 years ago  |  last reply 7 years ago


de-code this #3

De-code this: 5,19,21,15,13 hints: go here

Posted by iproberry1 7 years ago  |  last reply 7 years ago


de-code this #4

Find the word it this code:  15,7,14,25,1,18,9,6,16 Hints: not every number is used to make the word it's a musical instrument last code rule

Posted by iproberry1 7 years ago  |  last reply 7 years ago


what is the capacitor code?

I have a green capacitor that has the code, .22k 100sc What is the value in uf?

Asked by madman11 9 years ago  |  last reply 9 years ago


Posting formatted code

How do I post properly formatted code with the new editor ? The old one accepted Arduino format cut/paste, the new one mangles it completely. Steve

Posted by steveastrouk 3 years ago  |  last reply 3 years ago


Bug in code formatting

When I add some sourcecode, select it and format it as code from the dropdown menu, it looks all right. But when I later change something in my Instructable, the code gets messed up and I have to write the whole block again. It's really annoying :(

Posted by metanurb 4 years ago  |  last reply 4 years ago


this "coding" is killing me!

WHY DOES MOST PAGES ON THIS SITE HAVE A code SOMEWARE IN THE TEXT? HELP!!!like ' or p br > '

Posted by maker12 10 years ago  |  last reply 9 years ago


SMD components codes

Its my first time using smd components i bought some transistor but i dont know how to identify itcode written on it is 3ft22what transistor is this and how you read code like these ?

Posted by DabuHackker 9 months ago  |  last reply 9 months ago


de-code this #5

De-code this: Care Rector You Hints: rearrange the letters to make the words (3 words) 1 word in the words above is used in the final code 1 word was used in a previous topic

Posted by iproberry1 7 years ago  |  last reply 7 years ago


game codes for Club.Nintendo.com

Hi. Can people PM me their club.nintendo codes inside of your game cases, on the back of a small booklet there is a code can you PM it too me if you don't mind? On wii's, Dsi's, wii games, and dsi games PLEASE...

Posted by Vynash 9 years ago  |  last reply 9 years ago


hexapod arduino code?

I have just finished designing and building a hexapod with 18 DOF..  powered by arduino nano and a 32 channel servo controller. i need help with code. please help.

Asked by icey.hood 3 years ago  |  last reply 3 years ago


arduino rov code?

Hi i'm looking for someone who can design me an arduino code for my rov project if you are interested please send me a message thanks

Asked by electroniccrazy 6 years ago  |  last reply 6 years ago


morse code machine

Hi, I think it would be cool if you could have a litte machine on your desk at school that could signal your friend with morse code without sound e.g. flags

Posted by bad apple 11 years ago  |  last reply 8 years ago