Driving an ATTINY85 off mains

I don't know what a DigiStump is.... mine are standard ATtiny85's.

Why did you have to alter the code to get it to compile? Surely then they never tested it to make sure it actually works/complies on an ATtiny85?

I have literally been all morning and got nowhere... don't put any more time into this please.

Thanks for your help

I suspect that you got the same "certificate error" that many people suffered from recently, when trying to install Attinycore.

@ptillisch documented a workaround.

If I roll back 5 versions.... it installs. I'll look at that link later. Thanks

... just looked... yea, gonna leave it with the old version for now.

I know we should be grateful, but why is so much stuff broken. It wastes so much time.

which had a small typo for the wrong zip-file which made the Arduino-IDE 1.8.19 trying to download the not accessible ZIP-file again instead of using the local copy stored on the harddisk

As this is corrected now just for historical reasons the original text as unfoldable details

[details = ]
and this workaround did

NOT WORK !

as documented in detail here
now documented how it works

[/details]

best regards Stefan

You are correct.

I just tried on a different PC with no Arduino packages cache present and a portable installation. I saw Attinycore is asking for a slightly different filename compared to the one in @ptillisch workaround.

So I made a small modification to the name of the file to be downloaded to make my installation of AttinyCore work.

Instead of downloading this file
http://azduino.com/bin/micronucleus/micronucleus-cli-2.5-azd1b-x86_64-mingw32.zip
I had to download this file
http://azduino.com/bin/micronucleus/micronucleus-cli-2.5-azd1b-i686-mingw32.zip

Can anyone point out why this NeoPixel code fails....

It doesn't like the fact that I am sending 4x values for the RGBW led strip. Works if I only send red, green and blue.

FAIL = strip.setPixelColor(1, red, green, blue, white);
OK = strip.setPixelColor(1, red, green, blue);

Yet this is straight from the Adafruit page...

The error:

C:\Users\steve\Documents\Arduino\Galaxis\2023 Redesign\ATtiny_trial_code_v1/ATtiny_trial_code_v1.ino:65: undefined reference to `Adafruit_NeoPixel::setPixelColor(unsigned int, unsigned char, unsigned char, unsigned char, unsigned char)'
collect2.exe: error: ld returned 1 exit status

#include "Wire.h"
#include "veml6040.h"                                                                        // Colour sensor library
#include <Adafruit_NeoPixel.h>
#include <SendOnlySoftwareSerial.h>

SendOnlySoftwareSerial mySerial(4);                                                          // Tx pin

#ifdef __AVR__
#include <avr/power.h>
#endif

VEML6040 RGBWSensor;

#define RGBWpin        1
#define NUMPIXELS      2
Adafruit_NeoPixel strip(NUMPIXELS, RGBWpin, NEO_RGBW + NEO_KHZ800);                    

byte red = 0;
byte green = 0;
byte blue = 0;
byte white = 0;


void setup() {
  mySerial.begin(115200);

  Wire.begin();
  if (!RGBWSensor.begin()) {
    mySerial.println("ERROR: couldn't detect the sensor");
    while (1) {}
  }

  RGBWSensor.setConfiguration(VEML6040_IT_320MS + VEML6040_AF_AUTO + VEML6040_SD_ENABLE);

  delay(1500);
  mySerial.println("Vishay VEML6040 RGBW color sensor auto mode example");
  mySerial.println("CCT: Correlated color temperature in \260K");
  mySerial.println("AL: Ambient light in lux");
  delay(1500);

  strip.setBrightness(64);
  strip.begin();
}


void loop() {
  mySerial.print("RED: ");
  mySerial.print(RGBWSensor.getRed());
  mySerial.print(" GREEN: ");
  mySerial.print(RGBWSensor.getGreen());
  mySerial.print(" BLUE: ");
  mySerial.print(RGBWSensor.getBlue());
  mySerial.print(" WHITE: ");
  mySerial.print(RGBWSensor.getWhite());
  mySerial.print(" CCT: ");
  mySerial.print(RGBWSensor.getCCT());
  mySerial.print(" AL: ");
  mySerial.println(RGBWSensor.getAmbientLight());
  delay(400);

  strip.setPixelColor(1, red, green, blue, white);                            // pixels RGBW colours
  strip.show();
  //strip.clear();
}

Its because the command on THEIR WEBPAGE is wrong

its not: strip.setPixelColor(1, red, green, blue, white);

This works:
strip.setPixelColor(1, strip.Color(red, green, blue, white));

:rage: :rage: :rage:

Even this small?

Read the whole of the site. It depends on how red, green, blue, white are defined. They are not defined as single bytes.

1 Like

I have tried these, but i decided i will never use a circuit with just a single power limiting capacitor, better to use a schematic with one on each side of the AC input, with drain resistor each of course. In the end the size of those capacitors is such that you may as well get a proper PSU. (also the power rating ends up to be quite low, enough to drive a mosfet or a few led, but not quite enough to run a MCU.

@DrAzzy would be the one to ask,

True, but i actually had a clean windows install on my desktop and ran into some issues as well.

That is 230v to 5v? :face_with_monocle:

looks like 5v to 5v to me, but you can add a wall charger to get you to the 5v.

Its just a USB breakout #ReadTheThread

hehehe...

That is just, well that is disturbing. They must have forgotten to add the overloaded function for 4 shades.

No.
A USB charger input socket.

You could mount it vertical if you want.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.