Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - TheQuestor

Pages: 1
1
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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.

2
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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.

3
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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?

4
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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.

5
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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.

6
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« 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.

7
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« on: March 18, 2021, 05:57:22 PM »
I tried both pin 9 and pin 6; neither did anything.  The red wire from the LED is going to the pin; the black wire to GND.  They light up normally with the digitalWrite(LED06, HIGH) command, so I know the LED's are both wired properly and working.

8
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« on: March 18, 2021, 05:10:44 PM »
Yes, I'm doing pin 6.  According to the site, 6 should be one of the PWM pins (3, 5, 6, 9, SS  and MOSI).  Am I reading this list wrong?  Or is IO6 = 6, and IO9 = 9?

9
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« on: March 18, 2021, 04:58:48 PM »
You said that pins IO3, IO5, IO6, IO9, SS (IO10), MOSI (IO11) are PWM; I'm assuming you're referring to the pins marked 3, 5, 6, 9, SS  and MOSI; I have the LED connected to pin 9, but it does NOT do anything at all.

Code: [Select]
    int brightness = 0;    // how bright the LED is
    int fadeAmount = 5;    // how many points to fade the LED by
    // set the brightness of pin 6:
    analogWrite(LED06, brightness);
    // change the brightness for next time through the loop:
    brightness = brightness + fadeAmount;
    // reverse the direction of the fading at the ends of the fade:
    if (brightness <= 0 || brightness >= 255)
      {
        fadeAmount = -fadeAmount;
      }
    // wait for 30 milliseconds to see the dimming effect
    delay(30);

What am I missing here?  If I change the initial brightness to 255, the LED comes on, but never dims.  It's neither brightening nor dimming this LED.

10
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« on: March 18, 2021, 02:49:11 PM »
Ok... but which pin is a PWM pin on this board??  I can't find anything online that tells me.


11
TinyDuino Processors & TinyShields / Re: Unknown problem with sketch
« on: March 17, 2021, 10:15:08 PM »
Actually, I had the LED connected to #1, not #4; it turned on, then acted weird - probably because I was addressing the wrong pin.  Oops.  Can you tell me how do do a ramp up/ramp down (gradually brighter, gradually dimmer) for an LED?  Thanks!

12
TinyDuino Processors & TinyShields / Unknown problem with sketch
« on: March 17, 2021, 01:07:13 PM »
Ok, I have my board working (finally!)

I uploaded the included blink code, and it worked perfectly.  So, now it's time to do my own first sketch.  Here's what I have:

Code: [Select]
//Pin Number Assignments:
const int LED1 = 4;

void setup()
  {
    pinMode(LED1, OUTPUT);
  }

void loop()
  {
    digitalWrite(LED1, HIGH); // turn the LED on (HIGH is the voltage level)
    delay(1000);              // wait for a second
    digitalWrite(LED1, LOW);  // turn the LED off by making the voltage LOW
    delay(1000);              // wait for a second
  }

I'm using the Tinycircuits proto terminal blocks tinyshield (ASD2005-R-T-I):


The LED, which is attached to ground and #4, comes on immediately; it then sort of blinks (as if you had an intermittent wire -- that's the effect) - and then is on, but dimly.  That's it.  There's no repetitive blinking.  I'm obviously missing SOMETHING, but I don't know what.  I'm an expert programmer in BASIC, C, C#, PHP, and am currently learning python.  The structure of the program is correct; I'm wondering if I have something connected wrong.

Also:  Do I have to "clear" the memory of the board before uploading new code, or does it simply overwrite the old?  Any help is appreciated.  Eventually, I'm going to have nine different LED's, blinking on various schedules.  What I'd like to have is this:

1. Blink on while #2 is off.
2. Blink on while #1 is off.
3. Blink on while #3 is off.
4. Blink on while #4 is off.
5. Random sequence with #5, #6, & #7.
6. Random sequence with #5, #6, & #7.
7. Random sequence with #5, #6, & #7.
8. Ramp up/down (different timing from #9)
9. Ramp up/down (different timing from #8)

Any help is greatly appreciated!

13
TinyDuino Processors & TinyShields / Re: USB port not detected
« on: March 17, 2021, 12:36:01 PM »
Awesome.  You're the best.  Ok, I tried a different cable, and lo and behold - it works!  The program even ran properly.  Thanks!

14
TinyDuino Processors & TinyShields / Re: USB port not detected
« on: March 17, 2021, 07:45:42 AM »
I'm using Windows 10.  There's only 1 COM port listed (COM3) and my Prusa I3 MKIIIS is using that.  The software seems to be stuck on COM3, with no way to change it, and nothing else is showing up.

I tried 1 USB cable, and nothing happened; on the third cable, the light on the board came on; is it possible that this cord is STILL not correct?

15
TinyDuino Processors & TinyShields / USB port not detected
« on: March 15, 2021, 09:01:57 PM »
I just purchased a tinyduino ASM2001-R-L (with the lithium battery option) and a tinyshield ASD2101-R.  I plugged in the battery, turned on the switch, and then connected my tinyshield.  The light on the main board comes on - and that's all that happens.  There's no response from the system showing this board.  I installed the software/drivers, but I don't see it.  This cable is definitely good; I tried two other cables, but the board LED doesn't come on with them; with this cord, it does.  I'm assuming, therefore, that the cable is good.

Any ideas why this isn't being detected?  I already have a device on COM3; do I need to remove it?

Pages: 1
SMF spam blocked by CleanTalk