### Need AVR debugging/help

Here's my setup, I'm building an electronic car that needs to go a predetermined distance for a contest. We get the distance right before the challenge, and then my team is going to program it into the avr. We get distance feedback via an encoder wheel and a phototransistor with IR LED. The phototransistor pulls the pin (PB0) up. Do I need a pulldown resistor? The code powers a motor through a transistor via PB4. There is a calabrate function so that we can enter the distance on top, the calabrate function will turn it into a useful number, and then the code will run. The motor runs until the calabrated number is reached. Unfortuanteley the code doesn't work. Any help, please? I'm probably not specific enough in this little paragraph, so please leave a comment if this doesn't make any sense.The target uController is the attiny13/attiny13acode (this is one of the first AVR codes i've made, with the help of other team members):#include #include #include #define mmDistance 5 // the required distance in millimeters // For the aTTiny13a/*pinout:1) PB5, RESET2) PB3, CLK3) PB44) GND5) PB0 MOSI6) PB1 MISO7) PB2 SCK8) VCC*/ // Input from encoder wheel is PB0 (physical pin 5) // Output to motor is PB4 (physical pin 3)int Calibrate(int x) // Calibrate converts distance to set{ int y; y = x+3; return y;}int main(void){ int clickDistance, setDistance, on = 0; clickDistance = 0; // clickDistance is the distance travelled so far DDRB = 0b00001000; // setting outputs and inputs 00001000 setDistance = Calibrate(mmDistance); // setDistance is set distance in clicks PORTB = 0b00001000; // turn on motor on = 1; //on tells if previous sense had button on or off while(clickDistance < setDistance) { // while loop if(PINB == 0b00000000 && on == 1) // button off, previous true { clickDistance = clickDistance+1; // increments clickDistance by 1 on = 0; } if(PINB == 0b00001000) { on = 1; } } PORTB = 0b00000000; // turn off motor _delay_ms(5000); return (0);}

Topic by guyfrom7up   |  last reply

Guys, For all you guys who are into microcontrollers......TI is trying to take over some lost market shares of Arduino and so on. You can now order the MSP430 LaunchPad development tool in the TI webshop for only \$ 4,30 incl shipment worldwide!!! Check it out at www.ti-estore.com/Merchant2/merchant.mvc?Screen=PROD&Product;_Code=MSP-EXP430G2 More specs at the TI Wiki http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_%28MSP-EXP430G2%29 Happy programming..... ;)

Topic by ton2303   |  last reply

### how to "ROOT" samsung intercept for sprint Answered

1)     how do i "ROOT" my samsung intercept from sprint? i found a few apps that are amazing     ("wifi tethering", "set CPU", "root explorer" "root manager"), but  i need superuser (root)     access. can anyone explain what "ROOT" is and how to get it?     (update) I'm starting to understand "ROOT" is.) 2)      and what is  "KERNAL" 3)      i want to install flash player 10.1 on my intercept from sprint, but after i installed, it was the      same. do i have to root my phone? 4)     i cant find any good info on HOW to root the SPRINT INTERCEPT phone. 5)     which is better, the samsung moment, or the samsung intercept? 6)     is this the ONLY phone the SUCKS in EVERY SENSE (bad screen re;  unable to root;  no     multi-touch; android 2.1;  no flash support;  non-sensitive capacitive buttons;       unresponsive;  slow) 7)     (update), my phone updated today and now is running 2.2, froyo. now the capacitive      buttons work the way there supposed too. but i still cant i update flash.  and is rooting      gonna be possible (or at lest possible)? (re update 2011 Jan. 11) my phone still has no multi-touch (except for the "pinch to zoom" like before.but only on the browser); no flash player; and the hardware still SUCKS (bad res LCD screen, "EV-rev O" radio, ABSOLUTELY TERRIBLE built in memory) some reason this phone after the 2.2 update, is a LOT slower and more unresponsive then before. 8) does anyone know how to root this phone and flash it with some better-suited software for this model phone (m910)

Question by -max-   |  last reply

### Needed: a trick to debug a circuit on a breadboard - (The Spaghetti Incident)

The situation: I'm prototyping a circuit with a 14-legged logic IC on a breadboard. What happens: The picture tells it all: The breadboard looks like a Spaghetti Incident. What a mess. It's hard to find the right holes between all the leads sticking out, and avoiding shorts is even trickier. And of course: The circuit doesn't work. Not suprising considering the chaos. No biggie, but debugging a circuit on such a breadboard is a real pain! So please: Share your tips / tricks / magic to keep a proper and readable circuit on a breadboard. Thanks! Ynze PS: The circuit is not very complex btw. It's a solar engine, with one logic IC (NAND gates) and about 15 other parts. The circuit does contain feedback loops, which make it a bit trickier...

Topic by ynze   |  last reply

### microcontroller help

Hi i got aPICkit 2 Debug Express kithttp://www.microchipdirect.com/productsearch.aspx?Keywords=PICkit+2+Debug+Expressand a PICkit 2 Low Pin Count Demo Board http://www.microchipdirect.com/productsearch.aspx?Keywords=DM164120-1for my birthday and i was wandering where can i go to get started with it and what can be created using them. all help will be greatful thanks =)

Topic by jimbojonesy   |  last reply

### Are there any third-party Java tools for the Blackberry?

Is/are there any third-party Java SDKs or "compilers" that can be installed on a Blackberry; so BB source can be debugged/edited directly on the Blackberry? Thanks in advance.

### AVR debugger

I'm looking for a DIY debugger for atmel AVR microcontroller (ATMega644 to be exact but any other avr will do). that have step-by-step debug capabilities. DIY means i preferred making the circuit at home rater then buying some kit. thanks.

Question by axodus   |  last reply

### Set up gmail on Nokia C6-01?

A new Nokia C6-01 phone, I have already succeeded stetting up yahoo and hotmail on it. But each time I put the configuration of gmail, it gives me the error message - can't communicate with the mail server. Anyone has any ideas how to debug this? Thanks!

Question by hectintin   |  last reply

### Arduino WX code help for Weather Underground data upload?

Question by rwcwx   |  last reply

I program my picaxe turn it on and it runs sweet for about ~20s and then after perfect operation the led that was on starts blinking and it then doesn't respond to any thing? The function of this program was to turn an led when the readabc from an input is under 100. when i connect the +ve to the input it makes the debugger say 255 but then it doesn't get any new debug data some times all the other variables change as well and its real erratic. Any reasons why this may be happening?

Question by wee_man   |  last reply

### DIY IR Droid Module - 3.5mm to Infrared - Breadboard Prototype

Hey guys, I figured since I had grabbed so much great information from you all  I might try my luck with a little more! ;-) I have built this on my breadboard, powered with 6V 150mAh AC-DC converter. First connect saw at least one of the LEDs flicker dark orange and then go out. Assuming this means I burned it out, as afterwards I didn't notice any response. To prevent burning IR LEDs, I'll use visible LEDs, but I'm still concerned that my breadboard has a mistake. I'm pretty much worthless (but willing to learn, at least outside of the classroom setting!) at Phys II, so the debugging is foreign to me.  Pulling out the multimeter... What process should I be using to confirm that everything is powered correctly? The schematic is attached if you would like to customize your response to the hardware, but a general guide to debugging amplified LED circuits would be much appreciated as well! Additionally, if amplification the best way to go? How about a relay? Does that not offer the same (not Phys II...) amplitude? Smaller the better! Source List: - Schematic - Attached PDF - PCB Creation - https://www.instructables.com/id/Extreme-Surface-Mount-Soldering/ - Mounting plan - https://www.instructables.com/id/LEGO-Nikon-IR-Remote/ Thanks in advance! Andrew Oh, and I'll post a picture of it within the week to get another set of eyes. I must confess, it is a little ratty...

Question by JustUnicycle   |  last reply

### TI TPA2000D4DAP: What's the PowerPad and other questions?

Hi, A couple months agao, I ordered something from TI but I actually ordered to wrong thing. What I got was the TPA2000D4DAP (http://focus.ti.com/lit/ds/symlink/tpa2000d4.pdf). I set it aside because I couln't use it. As I look at it now, I see that on the bottom of the is a square silver piece. Looking at the datasheet, it says that there is "Space-Saving, Thermally-Enhanced PowerPAD." Is that the PowerPAD? I read the paper on the powerPAD and it says its reflow soldered but I can't do that. Could I just use thermal paste if I ever wanted to use it for something. Another question is about the DAP letters. Does it mean Debug Access Port? Just wanted to read the correct paper on TI's site. Thanks

Question by phillyj   |  last reply

### Grundig TV doesnt power up !

Hi everyone. I am new in this area, mention that I have the basis of electronics but I'm not good debugging. Now let's cut to the chase: I have a Grundig T70 - 540 text / GB, with chassis CUC 5310 (GCT 28 - do not know what this is, but may help). When I turned on the TV smelled burned and I quickly turned off from the button (the general). I opened, I checked visual components that can burn resistance, a capacitor etc, but I noticed nothing. I checked, because of the short time, the fuses on the board (I know, mistake). After i start the TV from general inside i hear a ticking, as the clock and nothing happens, the TV remains off. May it be the sound for entry in protection or something? What could it be?

Topic by danyelo   |  last reply

### How can I create a program that allows me to run it and automatically upload a sketch to arduino without the software?

I have an Arduino uno board, and a robot that can follow, and have obstacle avoidance. My robot is designed for a person at school who has crutches for life, and the robot follows her with her books. I want to create a program with visual studio that automatically uploads each sketch to the board, depend on which button to click on. I already have visual micro for Visual Studio 10, and when I debug it or build it, it just uploads it to the robot. I need it to be a .bat file or a .exe file. If anyone could help me with this, I will be extremely grateful. Any ideas? Below I have a screenshot of what the program plans on doing.

Question by 28holes   |  last reply

### Where can I buy a premade vox / PA-style voice-override circuit?

I have a pair of hearing protection headphones.  I want to play radio & walkie-talkie through them.  However, when the walkie talkie plays, I want the radio to cut out. This is a basic PA-style circuit.  Some sound mixers have this too.  I can find circuit schematics online, but no time to build a circuit. Is there a pre-made device I can buy to do this?  Ideally it'd be a small box with 3 audio jacks - 2 inputs & 1 output.  One of the audio inputs would override the other. This would also be great for things like music + GPS in the car.  Is there something premade that I can buy?  I'd rather not have to build & debug a DIY circuit, as I really don't have the time right now.

Question by jumpfroggy

### How to use a 3DS screen

Hi everyone! I have a spare  working 3DS screen (a friend of mine thought that her screen was broken, so she ordered a new one, and it turns out the problem wasn't solved so it didn't came from the screen, and she told me I could keep it if I wanted to). I'd like to know how I could use it in various projects, for debugging or for a more long term use. I don't need 3D (anyway I assume this wouldn't be possible unless I write a driver). Is it possible to add a VGA port? A HDMI or USB (I don't think that USB screens exists, but hey, we're on Instructables, everything is possible here ^^) Thanks for your help Please keep in mind that my knowledge in Electronics is not huge, as I study it for only two years in college, and now I only study Computer Technology. And also note that I'm French, I know my English speaking isn't perfect, so feel free to ask me to clarify any point that is not correct in your language

Topic by PepperBoy

### Need help with arduino code.?

Alright I asked this question on the arduino forums but nobody is giving me a straight answer, and it's getting annoying. I am using the capsense library on an attiny85, I want to count the number of times an even happens, in this case the capacitive censor exceeding a certain amount. Then based on that number I want it to turn on one led, or two, and so forth, to keep count. Can someone tell me how the f*****g get this to work? I try to use serial to debug and just get "Serial" not defined in this scope. Heres the code: #include #include CapacitiveSensor   cs_1_2 = CapacitiveSensor(1,2);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired int ledpin = 0; int countnumber = 0; void setup()                    {   cs_1_2.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example   pinMode (ledpin, OUTPUT); } void loop()                    {   long start = millis();   long total1 =  cs_1_2.capacitiveSensor(30);   if (total1 < 99) {    countnumber == 1;   }   if (countnumber = 1) {     digitalWrite(ledpin, HIGH);   } }

Question by XOIIO   |  last reply

Hello I am a newbie to the world of microcontrollers and would be really grateful for some advice about choosing one. Basically, I’m doing a final year university engineering project that requires an MCU to take a number of analogue inputs, do some processing, and spit out an analogue output that will drive a loudspeaker. My supervisor has recommended looking at the Philips LPC2148 and associated development kits (http://www.olimex.com/dev/lpc-h2148.html) because it is cheap and looks able to fulfil the following requirements: I/O – three analogue inputs (so 3 ADCs), 3 digital inputs (two servos and a bus for programming the controller), and one analogue output (requiring a DAC either built into the development board, or one I could connect on an add-on board) Speed – a program size of about 500 floating pt operations, processing samples at a rate of up to 400/second, hence of the order 200,000 floating pt operations per second. I think the LPC2148 uses fixed pt arithmetic so would need to perform the equivalent of this in fixed pt. Support – in place debugging support would be desirable; ability to be run on Windows; overall hardware and software cost of £100 or less. Does this chip and its development tools look up to the job? If not, would you recommend an alternative? Are there any other major criteria I’m neglecting in the process of selecting a MCU? Many thanks, Sam

Topic by samtheengineer   |  last reply

### FEETECH 17DOF DIY humanoid robot

Topic by Robotfans

### How to use Multiple mcp23017 chips with the adafruit mcp23017.h library?

Question by DELETED_MakiY2   |  last reply

### I need help with my arduino code, the error code is "stray #" . located at #define DO_NEXT 4

1.//iOS switch control example 2.//Simple version 3.#define MY_DEBUG 1 4.#include "BluefruitRoutines.h" 5. 6.//Pin numbers for switches 7.#define PREVIOUS_SWITCH A0 8.#define SELECT_SWITCH A1 9.#define NEXT_SWITCH A2 10. 11.//Actions 12.#define DO_PREVIOUS 1 13.#define DO_SELECT   2 14.#define DO_NEXT     4 15. 16.uint8_t readSwitches(void) { 17.  return (~(digitalRead(PREVIOUS_SWITCH)*DO_PREVIOUS 18.      + digitalRead(SELECT_SWITCH)*DO_SELECT 19.      + digitalRead (NEXT_SWITCH)*DO_NEXT) 20.     ) & (DO_PREVIOUS+ DO_SELECT+ DO_NEXT); 21.} 22. 23.//Translate character to keyboard keycode and transmit 24.void pressKeyCode (uint8_t c) { 25.  ble.print(F("AT+BLEKEYBOARDCODE=00-00-")); 26.  uint8_t Code=c-'a'+4; 27.  if (Code<0x10)ble.print("0"); 28.  ble.print(Code,HEX); 29.  ble.println(F("-00-00-00-00")); 30.  MESSAGE(F("Pressed.")); 31.  delay(100);//de-bounce 32.  while (readSwitches()) { //wait for button to be released 33.    /*do nothing*/ 34.  }; 35.  ble.println(F("AT+BLEKEYBOARDCODE=00-00")); 36.  MESSAGE(F("Released")); 37.} 38. 39.void setup() { 40.  if(MY_DEBUG) 41.  while (! Serial) {}; delay (500); 42.  Serial.begin(9600); Serial.println("Debug output"); 43.endif 44.  pinMode(SELECT_SWITCH, INPUT_PULLUP); 45.  pinMode(NEXT_SWITCH, INPUT_PULLUP); 46.  pinMode(PREVIOUS_SWITCH, INPUT_PULLUP); 47.  initializeBluefruit(); 48.} 49. 50.void loop() { 51.  uint8_t i=readSwitches(); 52.  switch (i) { 53.    case DO_PREVIOUS: pressKeyCode('p'); break; 54.    case DO_SELECT:   pressKeyCode('s'); break; 55.    case DO_NEXT:     pressKeyCode('n'); break; 56.  } 57.} void setup() {   // put your setup code here, to run once: } void loop() {   // put your main code here, to run repeatedly: }

Question by JacLir00179   |  last reply

### LED Cube problems

I am having some minor (or perhaps major) difficulties with my 3x3x3 Led Cube. I have a program that i wrote that cycles the different 3x3 cross sections and in 3 of the cross sections there is one column of leds that will light up even though it is not commanded or supplied power. I also have a sort of kill all routine that runs after each level is dislplayed that sets every pin to low. in my configuration the problem pins are pins 8, 17, and 26. if anyone knows how to debug this or help in any way it would be much appreciated. Thanks! I have a video of the LED cube with the problems here and a sample of my program here // kill all routine for(i=2, i<15, i++) { digitalWrite( i, LOW); } // Level routines that have problems of LEDs lighting up when they shouldn't elseif (LVL_Num ==10) {   for(j=0, j< Repeat, j++)   {    LED_ON(3); LED_ON(6); LED_ON(9);     delay(5)    LED_OFF(3); LED_OFF(6); LED_OFF(9);     delay(1)    LED_ON(11); LED_ON(14); LED_ON(17);    delay(5)    LED_OFF(11); LED_OFF(14); LED_OFF(17);    delay(1)    LED_ON(19); LED_ON(22); LED_ON(25);    delay(5)    LED_OFF(19); LED_OFF(22); LED_OFF(25);   } } elseif (LVL_Num ==11) {   for(j=0, j< Repeat, j++)   {    LED_ON(1); LED_ON(4); LED_ON(7);     delay(5)    LED_OFF(1); LED_OFF(4); LED_OFF(7);     delay(1)    LED_ON(11); LED_ON(14); LED_ON(17);    delay(5)    LED_OFF(11); LED_OFF(14); LED_OFF(17);    delay(1)    LED_ON(21); LED_ON(24); LED_ON(27);    delay(5)    LED_OFF(21); LED_OFF(24); LED_OFF(27);   } } elseif (LVL_Num ==13) {   for(j=0, j< Repeat, j++)   {    LED_ON(1); LED_ON(2); LED_ON(3);     delay(5)    LED_OFF(1); LED_OFF(2); LED_OFF(3);     delay(1)    LED_ON(13); LED_ON(14); LED_ON(15);    delay(5)    LED_OFF(13); LED_OFF(14); LED_OFF(15);    delay(1)    LED_ON(25); LED_ON(26); LED_ON(27);    delay(5)    LED_OFF(25); LED_OFF(26); LED_OFF(27);   } }

Question by Lee_Smith

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);   } }

Question by jbaker22   |  last reply

### [URGENT] Unable to Connect Ethernet Shield With Ubuntu:? Answered

Question by Beacon_av   |  last reply

### sensitivity of servo that is controlled via android phone

Good day everyone! just like to ask for an assistance on how to make the motion of the servo motor more sensitive with the tilt of the android phone... our program was to control the tilt of the ball maze board via android phone... our code was also given... we are just wondering if this is just the limitation of the Bluetooth connection... we are using amarino application also for the connection between android phone and bluesmirf... here's the code... #include #include float data[3] = {0}; int intdata[3] = {0}; int i = 1; Servo myservo; Servo myservo2; int pos = 0; // MeetAndroid meetAndroid(); // you can define your own error function to catch messages // where not fuction has been attached for MeetAndroid meetAndroid(error); float previousdata = 0; int elapsedtime = 0; void error(uint8_t flag, uint8_t values) {   Serial.print("ERROR: ");   Serial.print(flag); } void setup() {   Serial.begin(115200); //begin serial link @ 9600bps   // register callback functions, which will be called when an associated event occurs.   // - the first parameter is the name of your function (see below)   // - match the second parameter ('A', 'B', 'a', etc...) with the flag on your Android application   meetAndroid.registerFunction(floatValues, 'A');    myservo.attach(9); //Attach the servo to pin eleven   myservo2.attach(10); } void StopCar() {   myservo.write(90);   myservo2.write(90); } void loop() {   myservo.write(90);   myservo2.write(90);   meetAndroid.receive(); // you need to keep this in your loop() to receive events } void floatValues(byte flag, byte numOfValues) {   // create an array where all event values should be stored   // the number of values attached to this event is given by   // a parameter(numOfValues)     // call the library function to fill the array with values (floats)   meetAndroid.getFloatValues(data);     for (int i=0; i<3;i++)   {     meetAndroid.send(data[i]);//Used for debug purposes   }   if (-10<=data[1]<=10)   {      intdata[1] = int(data[1]); //Cast the X axis float value to int      intdata[1] = intdata[1]+10;      pos = intdata[1]*9;      myservo.write(pos);   }   if (-10<=data[0]<=10)   {     intdata[0] = int(data[0]);     intdata[0] = intdata[0]+10;     pos = intdata[0]*9;     myservo.write(pos);   }   if (previousdata == data[0]) { //If the data's still the same (It should have been changed by the meetAndroid.getFloatValues(data) function)      if ((elapsedtime-millis())>=1000) { //If the car has lost the signal more than 1sec, then stop the car         StopCar();      }    }             }

Topic by maevalen   |  last reply

### Virtualwire RF 433mhz Voltage problem

Topic by Senken   |  last reply

Question by earthtown   |  last reply

### Virtualwire RF 433mhz Voltage problem mk2

Hi, I have this code and have modded it a bit, i was wondering if there was a way of making the pincode more than 1 digit long? Also i have got the code sending command and pin code when buton to pressed and stopping when released and the receiver end reading it and seeing it stop, sending a pin high when it reads it but i cant get i to go low when it stops receiving it. wen ever it looks like it will work It seems to make the pin go to 0.16 when low to 0.24 when high. can you help? tom Transmitter code #include int button = 2;   void setup() {     Serial.begin(9600);     vw_set_ptt_inverted(true);     vw_setup(2000);     vw_set_tx_pin(4);     pinMode(button,INPUT);     pinMode(button,LOW);   }   void loop() {     while     (digitalRead(button) == LOW);      sendMessage("1", "5");      //delay(10000);   }   void sendMessage(char* pinCode, char *data) {      if (strlen(data) > 0) {       double startTime = millis();       Serial.println("Sending...");       int msgSize = (strlen(data) + strlen(pinCode) + 1);       char packetData[msgSize];       strcat(packetData, pinCode);       strcat(packetData, ".");       strcat(packetData, data);       Serial.println("Debugging ");       Serial.print("Sending Command: ");       Serial.print(data);       Serial.print(" with Pin Code: ");       Serial.print(pinCode);       Serial.print("\n");       vw_send((uint8_t *)packetData, msgSize);       vw_wait_tx();       double endTime = millis();       double timeTaken = (endTime - startTime);       Serial.print("Time Taken: ");       Serial.print(timeTaken);       Serial.print(" ms\n");     }    } Receiver Code #include   #include   int relay = 8;   byte message[VW_MAX_MESSAGE_LEN];   byte messageLength = VW_MAX_MESSAGE_LEN;   void setup() {     Serial.begin(9600);     vw_set_ptt_inverted(true);     vw_setup(2000);     vw_set_rx_pin(2);     vw_rx_start();     pinMode(relay,INPUT);     pinMode(relay,LOW);   }   void loop() {     while     //(vw_have_message())    (vw_get_message(message, &messageLength;))     {        int command = processResponse((char*)message, 1); //Byte Array Response and Pin Code.        if       // (vw_have_message());        (command) {          Serial.print("Received Command: ");          Serial.print(command);               Serial.print("\n");          digitalWrite (relay,HIGH);        }                   else //REMOVE          delay(100); //REMOVE          digitalWrite (relay,LOW); //REMOVE                 }    } int processResponse(char* message, int pinCode) {       char *p = message;       char *buf;       int o = 0;       int pin;       int command;       while ((buf = strtok_r(p, ".", &p;)) != NULL)  {          if (o == 0) {            pin = atoi(buf);                    } else {            command = atoi(buf);            ;          }          o++;       }       if (pinCode == pin && command > 0) {           return command;                 } else {          return 0;                         }   } This code only sends pin 8 from 0.14 when low to 0.17 when high. unless you remove the three lines marked REMOVE then it goes from 0.14 when low to 4.47 when high but stays there and will not go low when buttton it released. Please help

Topic by Senken

### My code compiles, but doesn't work?? Answered

Hi, i'm doing a project based on the capacitive sensor method. the code will work fine as standard, but when its  with my added extras it doesnt work but it compiles. The other thing is that the its printing to the serial at 3.4 seconds, do you know why this might be. here's the code. #include #include Servo Mech; int pos = 0;   /*   * CapitiveSense Library Demo Sketc  * Paul Badger 2008 5.  * Uses a high value resistor e.g. 10M between send pin and receive pin 6  * Resistor effects sensitivity, experiment with values, 50K - 50M. Larger resistor values yield larger sensor values. 7.  * Receive pin is the sensor pin - try different amounts of foil/metal on this pin 8.  */     CapacitiveSensor   cs_4_2 = CapacitiveSensor(4,2);        // 10M resistor between pins 4 & 2, pin 2 is sensor pin, add a wire and or foil if desired CapacitiveSensor   cs_4_6 = CapacitiveSensor(4,6);        // dnt need this CapacitiveSensor   cs_4_8 = CapacitiveSensor(4,8);        // 10M resistor between pins 4 & 8, pin 8 is sensor pin, add a wire and or foil int light = 13; int yellow = 12; //dnt need this int power = 11; int fans = 5; boolean status_light = LOW, status_light_prev = LOW; boolean status_yellow = LOW, status_yellow_prev = LOW; // dnt need this boolean status_power = LOW, status_power_prev = LOW;    void setup()                    {     cs_4_2.set_CS_AutocaL_Millis(0xFFFFFFFF);     // turn off autocalibrate on channel 1 - just as an example     Serial.begin(9600);     Mech.attach(9);     pinMode(light, OUTPUT);     pinMode(yellow, OUTPUT); // dnt need this     pinMode(power, OUTPUT);     pinMode(fans, OUTPUT); }   void loop()                    {      long start = millis();      long total1 =  cs_4_2.capacitiveSensor(30); // to power pin 11      long total2 =  cs_4_6.capacitiveSensor(30); // dnt need this      long total3 =  cs_4_8.capacitiveSensor(30); // to light        Serial.print(millis() - start);        // check on performance in milliseconds      Serial.print("\t");                    // tab character for debug windown spacing        Serial.print(total1);                  // print sensor output 1      Serial.print("\t\t\t");      Serial.print(total2);                  // print sensor output 2      Serial.print("\t\t\t");      Serial.println(total3);                // print sensor output 3        delay(100);                             // arbitrary delay to limit data to serial port          if (total1 > 200)        status_light = !status_light;      Serial.print("\tstatus_light = ");      Serial.print(status_light);      Serial.print("\t");          if (status_light)        Mech.write(20);     else     Mech.write(160);     delay(600);          if (status_light)        digitalWrite(light, HIGH);      else      digitalWrite(light, LOW);                if (total2 > 200)                // dnt need this        status_yellow = !status_yellow;      Serial.print("status_yellow = ");      Serial.print(status_yellow);           Serial.print("\t");      if (status_yellow)        digitalWrite(yellow, HIGH);        else        digitalWrite(yellow, LOW);     if (total3 > 200)       status_power = !status_power;      Serial.print("status_power = ");      Serial.println(status_power);      if (status_power)        digitalWrite(power, HIGH);      else        digitalWrite(power, LOW);        if (status_power)               if (status_power)        digitalWrite(fans, HIGH);        else        digitalWrite(fans, LOW);     } thank you for your help thank you.

Question by icey.hood   |  last reply

### wemos d1 mini blynk? display temperature&humidity?

Question by turbiny

### RadioShack Tri Color LED strip light show help?

I'm having partial success creating a synchronized light show by calling some colors and adding delays. My main problem is creating specific colors or even displaying one color on the entire strip.  here's the default code for the strip for arduino: #include // ******** DEBUG ==== should auto config to adapt different mother board ********* //#define DATA_1 (PORTF |=  0X01)    // DATA 1    // for ATMEGA //#define DATA_0 (PORTF &=  0XFE)    // DATA 0    // for ATMEGA //#define STRIP_PINOUT DDRF=0xFF  // for ATMEGA #define DATA_1 (PORTC |=  0X01)    // DATA 1    // for UNO #define DATA_0 (PORTC &=  0XFE)    // DATA 0    // for UNO #define STRIP_PINOUT (DDRC=0xFF)    // for UNO PROGMEM const unsigned long pattern_test_red[10][10]={   {0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000}, }; PROGMEM const unsigned long pattern_test_blue[10][10]={   {0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00}, }; PROGMEM const unsigned long pattern_test_green[10][10]={   {0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff}, }; PROGMEM const unsigned long pattern_test_white[10][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet1[][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet2[][10]={   {0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff},   {0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet3[][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff},   {0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x444444},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0xffffff,0x444444,0x111111},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0xffffff,0x444444,0x111111,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0xffffff,0x444444,0x111111,0x000000,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0xffffff,0x444444,0x111111,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xffffff,0x444444,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xffffff,0x444444,0x111111,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0xffffff,0x444444,0x111111,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0xffffff,0x444444,0x111111,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_rainbow[10][10]={   {0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000},   {0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000},   {0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000},   {0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff},   {0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff},   {0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff},   {0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00},   {0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00},   {0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00},   {0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000}, }; // *********************************************************************************************************** // * // *                            Power Up Init. // * // * // *********************************************************************************************************** void setup() {                  STRIP_PINOUT;        // set output pin - DEBUG: should auto detect which mother board for use   reset_strip();   //noInterrupts(); } // *********************************************************************************************************** // * // *                            Main Loop // * // * // *********************************************************************************************************** void loop() {   send_1M_pattern(pattern_test_red, 10, 500);   delay(500);   send_1M_pattern(pattern_test_blue, 10, 500);   delay(500);   send_1M_pattern(pattern_test_green, 10, 500);   delay(500);   send_1M_pattern(pattern_test_white, 10, 500);   delay(500);   send_1M_pattern(pattern_test_comet1, 10, 70);   delay(500);   send_1M_pattern(pattern_test_comet2, 10, 70);   delay(500);   send_1M_pattern(pattern_test_comet3, 10, 70);   delay(500);         while (1)   {     send_1M_pattern(pattern_test_rainbow, 10, 70);   }   /* frame++;     if(frame<=10) LEDSTRIP_PATTERN_0();     if(10     if(20     if(frame>30) frame=1;    */   //delay(1); } /******************************************************************************* * Function Name  : send_1M_pattern * Description    : Transmit pattern to whole 1 meter strip *                  * Input          : pointer to ROM pattern; pattern length; frame rate *                  * Output         : None * Return         : None *******************************************************************************/ void send_1M_pattern(const unsigned long data[][10], int pattern_no, int frame_rate) {   int i=0;   int j=0;   uint32_t temp_data;   for (i=0;i   {     noInterrupts();     for (j=0;j<10;j++)     {       temp_data=pgm_read_dword_near(&data;[i][j]);       send_strip(temp_data);     }     interrupts();     delay(frame_rate);   } } /******************************************************************************* * Function Name  : send_strip * Description    : Transmit 24 pulse to LED strip *                  * Input          : 24-bit data for the strip *                  * Output         : None * Return         : None *******************************************************************************/ void send_strip(uint32_t data) {   int i;   unsigned long j=0x800000;     for (i=0;i<24;i++)   {     if (data & j)     {       DATA_1;       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");          __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       /*----------------------------*/       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");        __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");        __asm__("nop\n\t");        __asm__("nop\n\t");        /*----------------------------*/            DATA_0;     }     else     {       DATA_1;       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");          DATA_0; /*----------------------------*/             __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");      /*----------------------------*/             }     j>>=1;   }   } /******************************************************************************* * Function Name  : reset_strip * Description    : Send reset pulse to reset all color of the strip *                  * Input          : None *                  * Output         : None * Return         : None *******************************************************************************/ void reset_strip() {   DATA_0;   delayMicroseconds(20); } //***********AND HERE"S MY MODIFIED LIGHT SHOW CODE:*********** #include // ******** DEBUG ==== should auto config to adapt different mother board ********* //#define DATA_1 (PORTF |=  0X01)    // DATA 1    // for ATMEGA //#define DATA_0 (PORTF &=  0XFE)    // DATA 0    // for ATMEGA //#define STRIP_PINOUT DDRF=0xFF  // for ATMEGA #define DATA_1 (PORTC |=  0X01)    // DATA 1    // for UNO #define DATA_0 (PORTC &=  0XFE)    // DATA 0    // for UNO #define STRIP_PINOUT (DDRC=0xFF)    // for UNO PROGMEM const unsigned long pattern_test_red[10][10]={   {0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xff0000}, }; PROGMEM const unsigned long pattern_test_blue[10][10]={   {0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x00ff00}, }; PROGMEM const unsigned long pattern_test_green[10][10]={   {0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x0000ff}, }; PROGMEM const unsigned long pattern_test_white[10][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet1[][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet2[][10]={   {0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff},   {0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000},   {0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_comet3[][10]={   {0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff},   {0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0x000000,0x000000,0xffffff,0x444444},   {0x111111,0x444444,0xffffff,0x000000,0x000000,0x000000,0x000000,0xffffff,0x444444,0x111111},   {0x000000,0x111111,0x444444,0xffffff,0x000000,0x000000,0xffffff,0x444444,0x111111,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0xffffff,0x444444,0x111111,0x000000,0x000000},   {0x000000,0x000000,0x111111,0x444444,0xffffff,0xffffff,0x444444,0x111111,0x000000,0x000000},   {0x000000,0x000000,0x000000,0xffffff,0x444444,0x444444,0xffffff,0x000000,0x000000,0x000000},   {0x000000,0x000000,0xffffff,0x444444,0x111111,0x111111,0x444444,0xffffff,0x000000,0x000000},   {0x000000,0xffffff,0x444444,0x111111,0x000000,0x000000,0x111111,0x444444,0xffffff,0x000000},   {0xffffff,0x444444,0x111111,0x000000,0x000000,0x000000,0x000000,0x111111,0x444444,0xffffff}, }; PROGMEM const unsigned long pattern_test_rainbow[10][10]={   {0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000},   {0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000},   {0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000},   {0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff},   {0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff},   {0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00,0x0000ff},   {0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00,0x00ff00},   {0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00,0xffff00},   {0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000,0xff7f00},   {0xff7f00,0xffff00,0x00ff00,0x0000ff,0x6f00ff,0x8f00ff,0x000000,0x000000,0x000000,0xff0000}, }; // *********************************************************************************************************** // * // *                            Power Up Init. // * // * // *********************************************************************************************************** void setup() {                  STRIP_PINOUT;        // set output pin - DEBUG: should auto detect which mother board for use   reset_strip();   //noInterrupts(); } // *********************************************************************************************************** // * // *                            Main Loop // * // * // *********************************************************************************************************** void loop() {   send_1M_pattern(pattern_test_white, 0, 0);   delay(36000);   send_1M_pattern(pattern_test_white, 500,0);   delay(5000);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);    send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);    send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);     send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 10, 70);   delay(10);   send_1M_pattern(pattern_test_white, 500, 0);   delay(4000);       while (1)   {     send_1M_pattern(pattern_test_rainbow, 10, 70);   }       /* frame++;     if(frame<=10) LEDSTRIP_PATTERN_0();     if(10     if(20     if(frame>30) frame=1;    */   //delay(1); } /******************************************************************************* * Function Name  : send_1M_pattern * Description    : Transmit pattern to whole 1 meter strip *                  * Input          : pointer to ROM pattern; pattern length; frame rate *                  * Output         : None * Return         : None *******************************************************************************/ void send_1M_pattern(const unsigned long data[][10], int pattern_no, int frame_rate) {   int i=0;   int j=0;   uint32_t temp_data;   for (i=0;i   {     noInterrupts();     for (j=0;j<10;j++)     {       temp_data=pgm_read_dword_near(&data;[i][j]);       send_strip(temp_data);     }     interrupts();     delay(frame_rate);   } } /******************************************************************************* * Function Name  : send_strip * Description    : Transmit 24 pulse to LED strip *                  * Input          : 24-bit data for the strip *                  * Output         : None * Return         : None *******************************************************************************/ void send_strip(uint32_t data) {   int i;   unsigned long j=0x800000;     for (i=0;i<24;i++)   {     if (data & j)     {       DATA_1;       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");          __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       /*----------------------------*/       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");        __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");        __asm__("nop\n\t");        __asm__("nop\n\t");        /*----------------------------*/            DATA_0;     }     else     {       DATA_1;       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");          DATA_0; /*----------------------------*/             __asm__("nop\n\t");       __asm__("nop\n\t");       __asm__("nop\n\t");      /*----------------------------*/             }     j>>=1;   }   } /******************************************************************************* * Function Name  : reset_strip * Description    : Send reset pulse to reset all color of the strip *                  * Input          : None *                  * Output         : None * Return         : None *******************************************************************************/ void reset_strip() {   DATA_0;   delayMicroseconds(20); }

Question by ray33_

Topic by Downunder35m   |  last reply

### QUICK: Ideas for getting drone out of tree! [EDIT: already got it down, but ideas are welcome!]

Question by -max-   |  last reply

### How to make Flip Clock Numbers and build a "like"-counter around it?

Question by woutervddn   |  last reply

### Help for realising a linefollower tankbot

Topic by julianpe   |  last reply

### Problem in arduino code... you'll have to run this one to understand - Word Clock? Answered

Question by pro2xy   |  last reply

### The future of mobile operating system or the end for "hackers" and rooting?

Topic by Downunder35m

### I need help for my electric imp/arduino project....

Topic by qquuiinn   |  last reply

### Help With Arduino Robot Arm Record & Playback With SD Card, Bluetooth

Topic by steve444   |  last reply