Posts

Showing posts from July, 2026

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...

python check balance

 class bank():     def __init__(self,name,age,balance):         self.name=name         self._age=age         self.__balance=balance     def display(self):         print(self.name,self._age,self.__balance) obj=bank("sai",90,134) obj.name="dimpul" obj._age=23 obj.__balance=1234 obj.display()

Linked list in python

 class ll:     def __init__(self,n):         self.n=n         self.next=None node=ll(10) node.next=ll(20) node.next.next=ll(30) node.next.next.next=ll(44) count=0 new_node=ll(98) new_node.next=node.next node.next=new_node curr=node while(curr!=None):     print(curr.n,end=" ")     curr=curr.next  import java.util.Scanner; class Main {     public static void main(String[] args) { Scanner sc=new Scanner(System.in); int num=sc.nextInt(); int ornum=num; int sum=0; while(num>0){     int digit=num%10;     //int sum=0;     sum= sum + (digit * digit * digit);     num=num/10; }if(ornum==sum){ System.out.println("Is a armstrong");     }     else{         System.out.println("Is a not armstrong");     } } }fewf