Posts

JAVA

Java Array Programs 1. Print Array Elements import java . util . Scanner ; public class Main { public static void main ( String [] args ) { Scanner sc = new Scanner ( System . in ); System . out . print ( "Enter size of array: " ); int size = sc . nextInt (); int [] arr = new int [ size ]; System . out . print ( "Enter array elements: " ); for ( int i = 0 ; i < size ; i ++ ) { arr [ i ] = sc . nextInt (); } System . out . println ( "Array Elements:" ); for ( int i = 0 ; i < size ; i ++ ) { System . out . print ( arr [ i ] + " " ); } } } 2. Sum of Array Elements import java . util . Scanner ; public class Main { public static void main ( String [] args ) { Scanner sc = new Scanner ( System . in ); System . out . print ( "Enter size of array: " ); ...

Embedded

23EC35 – Embedded Firmware Development and QA Lifecycle (PE–V) B.Tech VII Semester – ECE Regulation:  R23 College:  Lakireddy Bali Reddy College of Engineering (Autonomous), Mylavaram L–T–P–C:  3–0–0–3 Prerequisites:  None 🎯 Course Outcomes After completing this course, you should be able to: CO Course Outcome Level CO1 Understand embedded product requirements and Embedded C programming for hardware-software architecture L2 CO2 Design and implement embedded firmware using HAL and software testing fundamentals L3 CO3 Examine embedded communication protocols and test-design methodologies L3 CO4 Understand firmware architecture and debugging using serial logging and IDE tools L2 CO5 Develop basic automation scripts for firmware validation, bootloader, OTA and firmware release L3 UNIT – I Embedded Product Development + Microcontroller + Embedded C 1. Embedded Product Development & System Engineering Embedded product development lifecycle System engineering principle...

General programs on java

Sorted array  import java.util.Scanner; public class Main{     public static void main(String []args){        Scanner sc=new Scanner(System.in);        System.out.println("array size");        int s=sc.nextInt();        int temp;        int arr[]=new int[s];        for (int i=0;i<s;i++){            arr[i]=sc.nextInt();        }        System.out.println("array elements");        for (int i=0;i<s;i++){            System.out.print( arr[i]+" ");        }        for (int i=0;i<s-1;i++){            for (int j=0;j<s-i-1;j++){                if(arr[j]>arr[j+1]){                 ...

Embedded

Image
PB0 Functions Function Description GPIO Input Read a push button or switch GPIO Output Control an LED, relay, or buzzer ADC Input Read analog signals from sensors (if enabled on this pin) EXTI External interrupt input Timer / Alternate Function PWM generation or timer input/output (depending on the timer mapping) Common Uses 1. LED Control HAL_GPIO_WritePin ( GPIOB , GPIO_PIN_0 , GPIO_PIN_SET ); // LED ON HAL_GPIO_WritePin ( GPIOB , GPIO_PIN_0 , GPIO_PIN_RESET ); // LED OFF 2. Push Button if ( HAL_GPIO_ReadPin ( GPIOB , GPIO_PIN_0 ) == GPIO_PIN_SET ) { // Button is pressed } 3. Analog Sensor You can connect: Potentiometer LM35 Temperature Sensor LDR Soil Moisture Sensor (analog output) to  PB0  if it is configured as an ADC input. 4. PWM Output PB0 can be configured as a timer output to: Control LED brightness Drive a servo motor Control DC motor speed Pin Type PB0 │ ├── GPIO ├── ADC ├── EXTI └── Timer (Alternate Function) In STM32CubeMX Click  PB0  and you...