Uncategorized

pyCV Codes

Posted on

import numpy as np import cv2 img = cv2.imread(‘./images/trex.png’) cv2.imshow(‘image’, img) cv2.waitKey(0) cv2.destroyAllWindows() cv2.namedWindow(‘image’, cv2.WINDOW_NORMAL) cv2.imshow(‘image’, img) cv2.waitKey(0) cv2.destroyAllWindows() cv2.imwrite(‘trex.jpg’, img) import cv2 image = cv2.imread(‘./images/trex.png’) cv2.imshow(“Original”, image) (b, g, r) = image[0, 0] print(“Pixel at (0, 0) – Red: {}, Green: {}, Blue: {}”.format(r, g, b)) image[0, 0] = (0, 0, 255) (b, g, […]

Uncategorized

8085 asm Codes

Posted on

;<Addition of two 8-bit numbers> MVI C,00 ;Initialize C register to 00 LDA 4150h ;Load the value to Accumulator. MOV B,A ;Move the content of Accumulator to B register. LDA 4151h ;Load the value to Accumulator. ADD B ;Add the value of register B to Accumulator. JNC LOOP ;Jump on no carry. INR C ;Increment […]

Uncategorized

8051 C Codes

Posted on

//Write an 8051 C program to send values 00 – FF to port P1. //Solution: #include <reg51.h> void main(void) { unsigned char z; for (z=0;z<=255;z++) P1=z; } //Write an 8051 C program to send hex values for ASCII characters of //0, 1, 2, 3, 4, 5, A, B, C, and D to port P1. //Solution: […]

Uncategorized

8051 asm Codes

Posted on

;This program adds value 3 to the ACC ten times MOV A,#0 ;A=0, clear ACC MOV R2,#10 ;load counter R2=10 AGAIN: ADD A,#03 ;add 03 to ACC DJNZ R2,AGAIN ;repeat until R2=0,10 times MOV R5,A ;save A in R5 ;Write a program to (a) load the accumulator with the value 55H, and ;(b) complement the […]