User Tools

Site Tools


attiny85

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
attiny85 [2025/08/20 22:28] ei5iybattiny85 [2025/08/20 22:31] (current) ei5iyb
Line 12: Line 12:
  
 https://www.instructables.com/How-to-Setup-DigiSprak-Attiny85-Board/ https://www.instructables.com/How-to-Setup-DigiSprak-Attiny85-Board/
 +
 +
 +Sample sketch with LED connected to pin 1 and GND
 +<code>
 +void setup() {                
 +  // Initialize the digital pin as an output
 +  pinMode(0, OUTPUT);      // LED on Model B
 +  Serial.begin(9600);
 +
 +  // if analog input pin 0 is unconnected, random analog
 +  // noise will cause the call to randomSeed() to generate
 +  // different seed numbers each time the sketch runs.
 +  // randomSeed() will then shuffle the random function.
 +  randomSeed(analogRead(0));
 +}
 +
 +void loop() {
 +  digitalWrite(0, HIGH);   // Turn the LED on
 +  // delay(random(1500));             // Wait for a second
 +  delay(2000);
 +  digitalWrite(0, LOW);    // Turn the LED off
 +  //delay(random(500));             // Wait for a second
 +  delay(1000);
 +}
 +</code>
 +
attiny85.1755728934.txt.gz · Last modified: by ei5iyb