Skip to main content

Posts

How to build a barcode scanning application?

Files included in the program:  AndroidManifest.xml <uses-feature android :name ="android.hardware.camera.any" /> <uses-permission android :name ="android.permission.CAMERA" /> build.gradle (Module :app) def camerax_version = "1.2.2" implementation "androidx.camera:camera-core: $ { camerax_version } " implementation "androidx.camera:camera-camera2: $ { camerax_version } " implementation "androidx.camera:camera-lifecycle: $ { camerax_version } " implementation "androidx.camera:camera-video: $ { camerax_version } " implementation "androidx.camera:camera-view: $ { camerax_version } " implementation "androidx.camera:camera-extensions: $ { camerax_version } " implementation 'com.google.mlkit:barcode-scanning:17.2.0' implementation 'com.intuit.sdp:sdp-android:1.0.6' implementation 'com.intuit.ssp:ssp-android:1.0.6' implementation 'androidx.camera:camera-mlkit-visi
Recent posts

Implement a preview using CameraX | Java

 MainActivity.java package com.simpy.preview; import android.Manifest; import android.content.pm.PackageManager; import android.os.Bundle; import android.widget.Toast; import androidx.activity.EdgeToEdge; import androidx.annotation.NonNull; import androidx.appcompat.app.AppCompatActivity; import androidx.camera.core.Camera; import androidx.camera.core.CameraSelector; import androidx.camera.core.Preview; import androidx.camera.lifecycle.ProcessCameraProvider; import androidx.camera.view.LifecycleCameraController; import androidx.camera.view.PreviewView; import androidx.core.app.ActivityCompat; import androidx.core.content.ContextCompat; import androidx.core.graphics.Insets; import androidx.core.view.ViewCompat; import androidx.core.view.WindowInsetsCompat; import androidx.lifecycle.LifecycleOwner; import com.google.common.util.concurrent.ListenableFuture; import com.google.mlkit.vision.barcode.BarcodeScanner; import java.util.concurrent.ExecutionException; import java.util.concurrent.Ex

How to play a video from the Internet in Android Studio - Programming Tutorial

How to play a video from the Internet in Android Studio - Programming Tutorial AndroidManifest.xml < uses-permission  android :name ="android.permission.INTERNET" /> MainActivity.java package  com.example.myapplication ; import android.os.Build ; import android.os.Bundle ; import androidx.activity.EdgeToEdge ; import androidx.appcompat.app.AppCompatActivity ; import androidx.core.graphics.Insets ; import androidx.core.view.ViewCompat ; import androidx.core.view.WindowInsetsCompat ; import androidx.media3.common.MediaItem ; import androidx.media3.exoplayer.ExoPlayer ; import androidx.media3.ui.PlayerView ; public class MainActivity extends AppCompatActivity { private PlayerView playerView ; private ExoPlayer player ; private boolean playWhenReady = true ; private Long playbackPosition = 0L ; private MediaItem mediaItem ; @Override protected void onCreate ( Bundle savedInstanceState) { super .onCreate(savedInstanceState); EdgeTo

Privacy Policy

Introduce We always strive to protect our customers' personal information. Customer Data The application fully commits not to collect and share data with third parties.

Using PIC16F887 microcontroller to control 8 single leds on and off using timer interrupt T1

Requirements: Use a PIC16F887 microcontroller to control 8 single leds on and off using the timer interrupt T1 with a delay period of 262ms.  Circuit diagram on Proteus simulation software  Figure 1. Controlling 8 LEDs to turn on and off using interrupts Main program : File: main.c ___________________ #INCLUDE <16F887.H> #FUSES NOWDT,PUT,HS,NOPROTECT,NOLVP #USE DELAY(CLOCK=20M) UNSIGNED INT8 X; #int_timer1 void interrupt_timer1() {    X=~X;    OUTPUT_D(X); } VOID MAIN() {     SET_TRIS_D(0x00); X=0X00; OUTPUT_D(X);    SETUP_TIMER_1(T1_INTERNAL | T1_DIV_BY_8);    SET_TIMER1(0);    ENABLE_INTERRUPTS(GLOBAL); ENABLE_INTERRUPTS(INT_TIMER1);    WHILE(TRUE) {} } ___________________ Link download:  https://drive.google.com/file/d/1e_8QOGfguNwGeuFN-T0MR9-vJyvMLAmz/view

Use PWM of PIC 16F887 to control 1 led

Requirements: Use PWM of PIC 16F887 to control 1 led. Let the frequency of the quartz capacitor be 20MHz. Given a PWM period of 0.8ms. Let's calculate the parameters and write a program to control the led light with level 1 equal to 1 tenth of the maximum brightness.   Circuit diagram on Proteus simulation software: Figure 1. The control circuit changes the light intensity of the lamp using PWM Main program : File: main.c ___________________ #INCLUDE <16F887.H> #FUSES NOWDT,PUT,HS,NOPROTECT,NOLVP #USE DELAY(CLOCK=20M) UNSIGNED INT16 BIEN_TOC_DO; VOID MAIN() {    SET_TRIS_C(0X00);    SETUP_CCP1(CCP_PWM);    SETUP_TIMER_2(T2_DIV_BY_16,249,1);    BIEN_TOC_DO=500;    SET_PWM1_DUTY(BIEN_TOC_DO);    WHILE(TRUE){} } ___________________ Link download:  https://drive.google.com/file/d/1bTFkDOBbnVMOfTfktRKmekfiYAq1Ipf6/view