Go Down

Topic: Multi-threading question (Read 197 times) previous topic - next topic

whysofrail

Jul 04, 2015, 07:51 am Last Edit: Jul 04, 2015, 07:55 am by whysofrail
Hello all, I'm trying to create a button with a RGB LED that pulses. I first programmed the button to turn on a motor. Then I installed the RGB LED and programmed it. After the RGB LED was programmed the button lost functionality and wouldn't work. It appears that the RGB LED pulsing uses the only thread available on the arduino.

I'm trying to find a way to have my RGB LED pulse without losing functionality of the Button/Arduino (uno soon to be MEGA).  I've tried:

Code: [Select]
interrupt();
noInterrupt();




Please understand I can't post the code and if you won't agree with that please don't post at all. If you need me to clarify anything let me know. Thanks.

SurferTim

Blink without delay may be your solution. It is in the Examples - Digital in IDE 1.6.5.

You won't get a lot of help if you can't post your code. Is there something you think you are doing that we haven't seen before?


MorganS

#2
Jul 04, 2015, 04:44 pm Last Edit: Jul 05, 2015, 10:40 pm by MorganS
Often the best way to resolve this sort of problem is to try to write the simplest possible sketch which demonstrates the problem. Try to write something short for the forum which only does those two things.

If you can show the problem in less than 100 lines of code then it makes it easier for the real experts to diagnose it. If you can't make your short program show the error, then keep adding code until it does. Now you've found where the real problem is.

[Edit: typo]
GoForSmoke: "What GShield? You never mentioned a shield."

RayLivingston

Please understand I can't post the code and if you won't agree with that please don't post at all. If you need me to clarify anything let me know. Thanks.
Gee, my car won't start.  Can you tell me why?  Oh!  I'm not going to tell you what kind of car it is, or let you look at it.

You MUST be kidding....

Regards,
Ray L.

Ps991

I'm a little curious why you can't post your code.

Follow these steps:
1)Click the Arduino IDE window
2)Right click your code and click "Select All"
3)Right click your selected code and click "Copy"
4)while editing your post, press the </> button on the top left of the toolbar
5)Right click with your cursor in-between the [ code ] and [ /code ] tags and click "Paste"
6)Click the "Save" button to update your post. Viola, code posted :D
If you can't write your program in plain english where anyone could understand it then you have no hope of writing code for it.  -Delta_G

Go Up