Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Interactive sunflower that plays music when exposed to light. Can't figure out how to incorporate code
Post Body

As the title says, for my project I am building an interactive sunflower that plays music when there's light and stops when there's none. I found a neat code for a song but I don't know how to integrate it into my code.

I tried
void playsong(){

song code goes here}

before my loop

and then:

if (value1 > 0 && value1 <= 200) {

analogWrite (LED, 255);

playsong( );

}

else if (value1 > 200 && value1 < 255) {

analogWrite (LED, 255);

delay (1000);

analogWrite (LED, 0);

delay (1000);

}

else {

analogWrite (LED, 0);

}

What am I doing wrong? plz help.

Author
Account Strength
80%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
78
Link Karma
51
Comment Karma
27
Profile updated: 4 days ago
Posts updated: 1 year ago
uno

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
3 years ago