Recent Posts

21
Wirelings / Audio Amplifier Wireling
« Last post by randomvalue on March 22, 2021, 06:21:41 AM »
Dear all,

I recently purchased the wireling starter kit in an attempt to make a sound amplifier.

However, I'm unable to find any documentation regarding the integration of the audio amplifier wireling.

Is there any way to allow it to output the sound from the Microphone Wireling?

thank you!
22
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 19, 2021, 12:01:10 PM »
I actually removed the delay, but it's still slow.  Ideally, I'd like all of my effects to be happening simultaneously, but that's just not possible.  I guess close is good enough.
23
TinyDuino / Re: Unknown problem with sketch
« Last post by lennevia on March 19, 2021, 10:29:35 AM »
If you wanted the fade effect to move faster, you can decrease the delay. It looks like you have it at 50ms in your program.
24
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 19, 2021, 10:09:06 AM »
I actually "fixed" that problem -- however, the ramp up/down process was WAY too slow; I solved that by not only increasing the amount for the brightness, but calling the ramp functions before & after every delay within my 2nd function.  Not as good as I wanted, but good enough.
25
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 18, 2021, 08:09:45 PM »
Here's my entire code:

Code: [Select]
//Pin Number Assignments:
const int LED01 = 1;
const int LED02 = 2;
const int LED03 = 3;
const int LED04 = 4;
const int LED05 = 5;
const int LED06 = 6;
const int LED07 = 7;
const int LED08 = 8;
const int LED09 = 9;
int brightness1 = 0;    // how bright the LED is
int fadeAmount1 = 5;    // how many points to fade the LED by
int brightness2 = 0;    // how bright the LED is
int fadeAmount2 = 5;    // how many points to fade the LED by

void setup()
  {
    pinMode(LED01, OUTPUT);
    pinMode(LED02, OUTPUT);
    pinMode(LED03, OUTPUT);
    pinMode(LED04, OUTPUT);
    pinMode(LED05, OUTPUT);
    pinMode(LED06, OUTPUT);
    pinMode(LED07, OUTPUT);
    pinMode(LED08, OUTPUT);
    pinMode(LED09, OUTPUT);
    randomSeed(analogRead(0));
  }

void loop()
  {
    FlashPair();
    Sequence();
    Ramp1();
    Ramp2();
  }
void FlashPair()
  {
    digitalWrite(LED01, HIGH); digitalWrite(LED03, HIGH);
    digitalWrite(LED02, LOW);  digitalWrite(LED04, LOW);
    delay(500);
    digitalWrite(LED01, LOW);  digitalWrite(LED03, LOW);
    digitalWrite(LED02, HIGH); digitalWrite(LED04, HIGH);
  }
void Sequence()
  {
    long randNumber;
    //5 ~~ 5 ~~ 8 ~~ 8 ~~ 7 ~~ 7
    //8 ~~ 7 ~~ 5 ~~ 7 ~~ 5 ~~ 8
    //7 ~~ 8 ~~ 7 ~~ 5 ~~ 8 ~~ 5
    randNumber = random(1, 6);
    if (randNumber == 1)
      {
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW); delay(500);
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW); delay(500);
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW);
      }
    if (randNumber == 2)
      {
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW); delay(500);
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW); delay(500);
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW);
      }
    if (randNumber == 3)
      {
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW); delay(500);
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW); delay(500);
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW);
      }
    if (randNumber == 4)
      {
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW); delay(500);
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW); delay(500);
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW);
      }
    if (randNumber == 5)
      {
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW); delay(500);
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW); delay(500);
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW);
      }
    if (randNumber == 6)
      {
        digitalWrite(LED07, HIGH); delay(500); digitalWrite(LED07, LOW); delay(500);
        digitalWrite(LED08, HIGH); delay(500); digitalWrite(LED08, LOW); delay(500);
        digitalWrite(LED05, HIGH); delay(500); digitalWrite(LED05, LOW);
      }
  }
void Ramp1()
  {
    // set the brightness of pin 6:
    analogWrite(LED06, brightness1);
    // change the brightness for next time through the loop:
    brightness1 = brightness1 + fadeAmount1;
    // reverse the direction of the fading at the ends of the fade:
    if (brightness1 <= 0 || brightness1 >= 255)
      {
        fadeAmount1 = -fadeAmount1;
      }
    // wait for 20 milliseconds to see the dimming effect
    delay(20);
  }
void Ramp2()
  {
    delay(150);
    // set the brightness of pin 9:
    analogWrite(LED09, brightness2);
    // change the brightness for next time through the loop:
    brightness2 = brightness2 + fadeAmount2;
    // reverse the direction of the fading at the ends of the fade:
    if (brightness2 <= 0 || brightness2 >= 255)
      {
        fadeAmount2 = -fadeAmount2;
      }
    // wait for 50 milliseconds to see the dimming effect
    delay(50);
  }

Everything seems to be working... except that pin 6 & pin 9 seem to be on, both at the same brightness, and aren't fading or brightening.  Am I missing something here?
26
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 18, 2021, 07:50:01 PM »
**CRASH!!*  (This is the sound of me banging my head on the desk).

DERP.

OMG.

I can't believe I did that.  Forty years of programming, and I made a rookie mistake like that.  Boy, do I feel dumb.  Thanks for enlightening me.  Now it works perfectly.
27
TinyDuino / Re: Unknown problem with sketch
« Last post by lennevia on March 18, 2021, 07:15:42 PM »
Can you verify you are using the exact Arduino example for pin 9 that I included above?

The program you included before differed from the Arduino example so I am unable to help you further without knowing what complete code you are using.

To clarify, the loop() in the Arduino program loops over and over on the TinyDuino, so the first line of the code snippet you included " int brightness = 0; " initializes and sets the brightness variable to zero on every loop iteration. This is likely the problem. The brightness variable, as shown in the Arduino example I included, needs to be a global variable outside of the loop() function in order to be usable between loop iterations.
28
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 18, 2021, 07:00:58 PM »
I wrote a simple piece of code that illuminated each LED in turn, from 1 to 9.  They all worked.  I have LED's connected to pins 1-9.  I modified the dimming code to try pin 3, 5, 6, & 9 separately, and uploaded each.  Each uploaded successfully.
29
TinyDuino / Re: Unknown problem with sketch
« Last post by lennevia on March 18, 2021, 06:57:25 PM »
The messy wiring on the ground pin could be shorting the gnd to a voltage pin right next to it. What LED are you using?

Quote
ALL of the LED's work independently,

Are you saying all of your LEDs have been tested and work with the pins you are programming?

Quote
I tried pins 3, 5, 6, and 9 - and none had any effect.

Does this mean that you edited and uploaded the program for each pin as you changed your hardware configuration? Are you uploading to the correct TinyDuino pin? Do you get a "Done uploading." message each time you upload the program?
30
TinyDuino / Re: Unknown problem with sketch
« Last post by TheQuestor on March 18, 2021, 06:38:54 PM »


Yes, I know my wiring is a bit messy, but ALL of the LED's work independently, without lighting any adjacent ones.  I tried pins 3, 5, 6, and 9 - and none had any effect.
SMF spam blocked by CleanTalk