Monday, December 30, 2019

EC25 adb and fastboot devices installation of ubuntu linux


How to install android drivers on ubuntu


How to Install ADB & Fastboot on Ubuntu 16.04, 16.10, 14.04



This tutorial is going to show you how to install ADB & fastboot on Ubuntu 16.04, 14.04, 16.10, which is quite easy.
What is ADB and Fastboot
ADB and fastboot are two components of the Android SDK Platform-Tools.
ADB stands for Android Debug Bridge. It’s a command line utility that allows you to do the following stuff:
  • Control your Android device over USB from your computer
  • Copy files back and forth
  • install and uninstall apps
  • run shell commands
  • and much more
Fastboot is a command line tool for flashing and Android device, boot an Android device to fastboot mode, etc…
How to Install ADB and Fastboot on Ubuntu 16.04, 16.10, 14.04
It’s super easy. Simply run the following commands in a terminal window to install them from Ubuntu repository.
sudo apt update
sudo apt install android-tools-adb android-tools-fastboot
To check ADB version, run
adb version
Sample output:
Android Debug Bridge version 1.0.32
Enable USB Debugging on Your Android Device
While you Android device is unplugged from USB, go to your Android settings, scroll all the way down and tap About phone or About device. Then tap Build number 7 times which makes you a developer.
Now go back to the settings, you will see a new button called Developer options. Tap that button and enable USB debugging.
Test the Installation
To check if ADB is working properly, connect your Android device to your Ubuntu computer via USB cable. After that, type the following command in your Ubuntu terminal window.
adb devices
You will be prompted to allow USB debugging from Ubuntu computer like the screenshot below. Select OK.

Then type run adb devices command again and your Android device will show up.

If you get the following error,
????????????    no permissions
Then all you need to do is restart adb daemon, run
sudo adb kill-server
Then
sudo adb start-server


EC25 basic commands list

use qcomm for debug which support at commands ..tool is very useful
download here


Friday, December 27, 2019

How to add a image to tkinter python

# -*- coding: utf-8 -*-
"""
Created on Fri Dec 27 14:38:52 2019

@author: Onyx1
"""
from tkinter import *
import tkinter as tk
from PIL import ImageTk, Image
from tkinter import ttk


#path = 'C:/xxxx/xxxx.jpg'
path = 'F:\my_workspace\python_workspace\onyx-logo.png'


root = tk.Tk()
img = ImageTk.PhotoImage(Image.open(path))
panel = tk.Label(root, image = img)
panel.pack(side = "bottom", fill = "both", expand = "yes")
root.mainloop()

output:


Saturday, December 21, 2019

Html table using python

# -*- coding: utf-8 -*-
"""
Created on Sat Dec 21 18:01:13 2019

@author: anil durgam
"""
import os
 
html = ""
def table(x):
global html
""" Create table with data in a multiline
string as first argument x)"""
html = "<!-- table -->"
html += "<table border=1>"
for line in x.splitlines():
for n in line.split():
html += f"<td>{n}</td>"
html += "<tr>"
html += "</table>"
return html

def create(a):
tab = table(text.get("1.0", tk.END))
text.delete("1.0", tk.END)
text.insert("1.0", tab)
label['text'] = "Now you can copy the html code for the table (ctrl + a)"

def save_html():
if html != "":
with open("table.html", "w") as file:
file.write(text.get("1.0", tk.END))

def show_html():
if os.path.exists("table.html"):
os.startfile("table.html")

def convert_to_html():
html = table(text.get("1.0",tk.END))
clear()
text.insert("1.0", html)

def clear():
text.delete("1.0", tk.END)

import tkinter as tk
root = tk.Tk()
root.title("Html table converter")
label = tk.Label(root, text="Insert data here separated by space and press Ctrl+c to convert to html table:")
label.pack()
text = tk.Text(root)
text.pack()
text.bind("<Control-c>", create)
text.focus()
# create a toplevel menu
menubar = tk.Menu(root)
menubar.add_command(label="Convert - crtl+c |", command=convert_to_html)
menubar.add_command(label="Save  |", command=save_html)
menubar.add_command(label="Show  |", command=show_html)
menubar.add_command(label="Clear screen  |", command=clear)
# display the menu
root.config(menu=menubar)
root.mainloop()

output:



tkinter nested for loop in python

# !/usr/bin/python3
from  tkinter import *
root = Tk(  )
b = 0
for r in range(6):
   for c in range(6):
      b = b + 1
      Button(root, text = str(b), borderwidth = 1 ).grid(row = r,column = c)

root.mainloop()

output:

set in python


s={10,20,30,40}
print(s)
print(type(s))


output:
{40, 10, 20, 30}
<class 'set'>

example 2:
s={10,20,30,40}
s1=s
print(s)
print(type(s))
print(id(s1),id(s))

output:
{40, 10, 20, 30}
<class 'set'>
1861259155048 1861259155048

In above case both s1 and s representing same id
but copying is not done


example 3:
by copy method

s={10,20,30,40}
s1=s.copy()
print(s)
print(type(s))
print(id(s1),id(s))

output:
{40, 10, 20, 30}
<class 'set'>
1861259156840 1861259157288

both s1 and s address are different

Friday, December 20, 2019

drop down menu in python using Tkinter

# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 13:15:37 2019

@author: anil durgam
version:1.0
example:MM32 microcontroller drop down menu
"""

from tkinter import ttk
import tkinter as tk
#from pprint import pprint
#scr = Tk()


class Application(ttk.Frame):
   
    def __init__(self, main_window):
        super().__init__(main_window)
        main_window.title("MM32_MENU_SELECTOR")
        tk.Label(main_window,text="MM32 microcontroller selected",fg = "blue",font = "Times").pack()
       
        self.combo = ttk.Combobox(self)
        self.combo.place(x=50, y=50)
        self.combo["values"] = ["MM32F", "MM32L",  "MM32W", "MM32SPIN", "MM32P"]
        self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
           
        main_window.configure(width=1024, height=500)
        self.place(width=300, height=200)
       
    def selection_changed(self, event):
        print("your selected::", self.combo.get())
        if self.combo.get()== "MM32F" :
            print("mm32f submenu displayed here\n")
            self.combo = ttk.Combobox(self)
            self.combo.place(x=50, y=100)
            self.combo["values"] = ["MM32F003", "MM32F031", "MM32F032", "MM32F103"]
            self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
           
            if self.combo.get()=="MM32F003":
                 print("mm32f003 submenu displayed here\n")
                 self.combo = ttk.Combobox(self)
                 self.combo.place(x=50, y=150)
                 self.combo["values"] = ["MM32F003TW", "MM32F003NW"]
                 self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
               
           
        elif self.combo.get()== "MM32L" :
            print("mm32L submenu displayed here\n")
            self.combo = ttk.Combobox(self)
            self.combo.place(x=50, y=100)
            self.combo["values"] = ["MM32L050", "MM32L051", "MM32L052", "MM32L061",
                      "MM32L062","MM32L072","MM32L073","MM32L362","MM32L373","MM32L384",
                      "MM32L395"]
            self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
         
       
        elif self.combo.get()== "MM32W" :
            print("mm32W submenu displayed here\n")
            self.combo = ttk.Combobox(self)
            self.combo.place(x=50, y=100)
            self.combo["values"] = ["MM32W051", "MM32W062", "MM32W073", "MM32W362"
                      , "MM32W373", "MM32W384", "MM32W395"]
            self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
         
           
        elif self.combo.get()== "MM32SPIN" :
            print("mm32SPIN submenu displayed here\n")
            self.combo = ttk.Combobox(self)
            self.combo.place(x=50, y=100)
            self.combo["values"] = ["MM32F003", "MM32F031", "MM32F032", "MM32F103"]
            self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
           
       
        else :
            print("mm32P submenu displayed here\n")
            self.combo = ttk.Combobox(self)
            self.combo.place(x=50, y=100)
            self.combo["values"] = ["MM32F003", "MM32F031", "MM32F032", "MM32F103"]
            self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
main_window = tk.Tk()
#lbl.pack()
#pprint(dict(lbl))
#root = tk.Tk()
T = tk.Text(main_window,width=100, height=10)
T.pack()
T.insert(tk.END, "MM32 main details\navailable here\n")

app = Application(main_window)
app.mainloop()



drop down menu in python

# -*- coding: utf-8 -*-
"""
Created on Fri Dec 20 13:15:37 2019

@author: anil durgam
"""

from tkinter import ttk
import tkinter as tk
class Application(ttk.Frame):
   
    def __init__(self, main_window):
        super().__init__(main_window)
        main_window.title("MM32_MENU_SELECTOR")
       
        self.combo = ttk.Combobox(self)
        self.combo.place(x=50, y=50)
        self.combo["values"] = ["MM32F", "MM32L", "MM32SPIN", "MM32W", "MM32P"]
        self.combo.bind("<<ComboboxSelected>>", self.selection_changed)
       
        main_window.configure(width=1024, height=500)
        self.place(width=300, height=200)
       
    def selection_changed(self, event):
        print("your selected::", self.combo.get())
main_window = tk.Tk()
app = Application(main_window)
app.mainloop()

Monday, December 16, 2019

tkinter text and font display


from tkinter import *
from pprint import pprint

scr = Tk()
scr.title("Label - Tkinter Widgets")

lbl = Label(scr, text="Hello", padx=5, pady=10, font=("Arial Bold", 20))


lbl.pack()
pprint(dict(lbl))
scr.mainloop()

Monday, December 9, 2019

write a program to take a tuple of numbers from the keyboard and print sum ,avg

a=eval(input("Enter  some of tuple numbers"))
l=len(a)
sum=0
for x in a:
    sum=sum+x
print("The sum=",sum)
print("The avg=",sum/l)

output:
Enter  some of tuple numbers(10,20,30)
The sum= 60
The avg= 20.0

Tuple comprehension not support in python

a=(x*x for x in range(1,11))
#print(a)
for x in a:
    print(x)

output:
1
4
9
16
25
36
49
64
81
100

Write a program for tuple packing in python

Tuple packing:
====================================

t=(10,20,30,40)
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)

output:
a= 10 b= 20 c= 30 d= 40



Tuple packing for strings:
==============================
t="abcd"
a,b,c,d=t
print("a=",a,"b=",b,"c=",c,"d=",d)

output:
a= a b= b c= c d= d

Perform Addition, Subtraction, Multiplication, Division and Modulus operation on two integers.


#include<stdio.h>
void main()
{ int a,b;
printf("\n enter two values: ");
scanf("%d %d",&a,&b);
printf("\n a + b = %d", a+b);
printf("\n a - b = %d", a-b);
printf("\n a * b = %d", a*b);
printf("\n a / b = %d", a/b);
printf("\n a modulus b = %d", a%b);
getch();
}




input:

 enter two values: 13  5

output:

 a + b = 18           
 a - b = 8
 a * b = 65
 a / b = 2
 a modulus b = 3

Tuesday, December 3, 2019

MM32f103 led blink program

To work on mind motion MM32 microcontroller we need to install the keil uvision 5 version
then install the mm32-link programmer

go to library folder their you will get the
MM32F103_library_examples\MM32F103xx_m_Lib_Samples_V1.01_SC\MM32F103RegLibMB_Ver1.9.5\Boards_MM32x103\MB103CBT6_lib\BLINK\IOToggle\KEIL_PRJ

open the file in keil. options target  their to need to do mm32-ulink.


/****************************************Copyright (c)****************************************************
**
**                                   
**
**--------------File Info---------------------------------------------------------------------------------
** File name:      main.c
** modified Date:  2019-12-04
** Last Version:   V1.9.5
** Descriptions:   Led blink program by anil durgam
**
*********************************************************************************************************/
#include "sys.h"
#include "delay.h"
#include "uart.h"
#include "led.h"

int main(void)
{
 
    delay_init();  
 
    LED_Init();
 
    while(1)           
    {
        LED1=!LED1;
        LED2=!LED2;
        LED3=!LED3;
        LED4=!LED4;
        delay_ms(1000); 
    }
}



Monday, December 2, 2019

finding the length of tuple in python

t1=(10,20,30)
print(len(t1))

output:
3


multiplication of Tuple in python

t1=(10,20,30)
t2=t1*2
print(t2)


output:
(10, 20, 30, 10, 20, 30)

example 2:


t1=(10,20,30)
t2=t1*3
print(t2)

output:
(10, 20, 30, 10, 20, 30, 10, 20, 30)

addition of Tuple in python

t1=(10,20,30)
t2=(40,50,60)
t3=t1+t2
print(t1)
print(t2)
print(t3)

output 1:
(10, 20, 30)
(40, 50, 60)
(10, 20, 30, 40, 50, 60)

python class topic video