Posts

Project for Pi PICO to understand how Key Pads work

Image

Loading project arduino to understand how LCD work

Image

Dancing servo motors Arduino Mega

Image

Pi PICO 4-segment display counter

Image
The main CODE is here:  /**  * Pi Pico PIO driving a 4-digit seven segment display example.  *  * Copyright (C) 2021, Uri Shaked  */ #include " segment.pio.h " uint8_t digits[] = {   0b11000000 , // 0   0b11111001 , // 1   0b10100100 , // 2   0b10110000 , // 3   0b10011001 , // 4   0b10010010 , // 5   0b10000010 , // 6   0b11111000 , // 7   0b10000000 , // 8   0b10011000 , // 9 }; const uint8_t first_segment_pin = 2 ; const uint8_t first_digit_pin = 10 ; void setup () {   Serial1. begin ( 115200 );   Serial1. println ( "Raspberry Pi Pico PIO 7-Segment Example" );   // Load the PIO program and initialize the machine   auto offset = pio_add_program(pio0, &segment_program);   segment_program_init(pio0, 0 , offset, first_segment_pin, first_digit_pin); } void displayNumber(uint value) {   pio_sm_put(pio0, 0 ,     digits[value / 1000 % 10 ] << 24 |     digits[value / 100 % 10 ] << 16 |     digits[value / 10 % 10 ] << 8 |     digits[val

Smart Elevator simulation with arduino uno and Proteus

Image
Smart Elevator simulation with arduino uno and Proteus  // By HomeMade Electronics // Subscribe to my channel https://www.youtube.com/channel/UC8isJR_71x1wIfw6jB106pg // for more tutorial videos // like, share and leave a comment if you need help #include "HX711.h"  // Get this library by clicking on Sketch > Include Library > Library Manager in the Arduino IDE and install it from there #include <LiquidCrystal.h> // Define calibration factor obtained using the SparkFun_HX711_Calibration sketch #define calibration_factor 18029.57  // Define pin numbers #define IN1 4 #define IN2 5 #define DOUT  3 #define CLK  2 #define Bstart 6 #define Bstop 7 #define Bstopage 1 float weight; // Variable to store weight measurement HX711 scale; LiquidCrystal lcd(13, 12, 11, 10, 9, 8); // Function to move motor forward void forward() {   digitalWrite(IN1, HIGH);   digitalWrite(IN2, LOW); } // Function to move motor backward void backward() {   digitalWrite(IN1, LOW);   digitalWrite(

Traffiic lights with LCD and LEDS using ATMEGA32 with PROTEUS

Image
Main code: #include <avr/io.h> #include "LCD.h" #include "timer.h" #define F_CPU 8000000UL #include <util/delay.h> #include "LED.h" #include <avr/interrupt.h> volatile unsigned char counter1=0; volatile unsigned char counter_green=10; volatile unsigned char counter_yellow=5; volatile unsigned char counter_red=7; int main(void) { LED_vInit('D',0); LED_vInit('D',1); LED_vInit('D',2); LCD_vInit(); timer_CTC_init_interrupt();     while(1)     { counter_green=10; counter_yellow=5; counter_red=7; LCD_clearscreen(); LCD_vSend_string("remaining 10 sec"); LED_vTurnOn('D',0); while(counter_green>0) { if(counter1>=100) { counter1=0; counter_green--; LCD_movecursor(1,11); LCD_vSend_char(' '); LCD_vSend_char((counter_green%10)+48); } } _delay_ms(500); LED_vTurnOn('D',1); LED_vTurnOff('D',0);