Posts

Showing posts from December, 2022

Loops

Image
  int green_LED = 8; int yellow_LED = 12; void setup() {   pinMode ( green_LED, OUTPUT);   pinMode ( yellow_LED, OUTPUT); } void loop() {   for (int i = 0; i < 4; i++)   { digitalWrite(green_LED, HIGH);     delay(500);     digitalWrite(green_LED, LOW);     delay(500);   }   int j = 0;   while (j < 3)   { digitalWrite(yellow_LED, HIGH);     delay(500);     digitalWrite(yellow_LED, LOW);     delay(500);     j++;   } }

DS1307 RTC Module

Image
//Sketch for Set time #include <Wire.h> #include "RTClib.h" RTC_DS1307 rtc; char daysOfTheWeek[7][12] = {"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"}; void setup () {   Serial.begin(57600); #ifndef ESP8266   while (!Serial); // wait for serial port to connect. Needed for native USB #endif   if (! rtc.begin()) {     Serial.println("Couldn't find RTC");     Serial.flush();     abort();   }   if (! rtc.isrunning()) {     Serial.println("RTC is NOT running, let's set the time!");     // When time needs to be set on a new device, or after a power loss, the     // following line sets the RTC to the date & time this sketch was compiled     rtc.adjust(DateTime(F(__DATE__), F(__TIME__)));     // This line sets the RTC with an explicit date & time, for example to set     // January 21, 2014 at 3am you would call:     // rtc.adj...

Interfacing LED with Arduno Micro

Image
int i; void setup() {   // initialize digital pin LED_BUILTIN as an output.   pinMode(2, OUTPUT);   pinMode(3, OUTPUT);   pinMode(4, OUTPUT);   pinMode(5, OUTPUT);   pinMode(6, OUTPUT);   pinMode(7, OUTPUT); } void loop() {   for (i = 2; i <= 7; i++) {     digitalWrite(i, HIGH);        delay(100);                            digitalWrite(i, LOW);         delay(100);   }      for (int i = 7; i > -2; i--){          digitalWrite(i, HIGH);     delay(100);     digitalWrite(i, LOW); } }  

ATTiNY 85 burn Bootloader and Programming

Image
https://www.instructables.com/How-to-Program-an-Attiny85-From-an-Arduino-Uno/ step1 Open Arduino IDE and go to file -Example - ArduinoISP connect the Arduino uno to PC and go to tools- select Board-Arduino Uno,