Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- '''class Table:
- def __init__ (self, l, w, h):
- self.L = l
- self.W = w
- self.H = h
- class KitchenTable(Table):
- def setPlaces(self,p):
- self.places = p
- class DeskTable(Table):
- def S(self):
- return self.W * self.L
- class forSklad(DeskTable):
- def O(self):
- return self.S * self.H
- class computerTable(DeskTable):
- def setComputerS(self,a):
- self.computerS = a
- def square (self):
- return self.W * self.L - self.computerS
- DenisStol = computerTable(1.5,0.7,1)
- DenisStol.setComputerS(0.09)
- AntonStol = DeskTable(1.5,0.7,1)
- print(AntonStol.S())
- print(DenisStol.S())'''
- things = 0
- chars = []
- pins = []
- tips = []
- funct = []
- work = []
- def Arduino():
- print("сколько будет переменных?")
- things = int(input())
- for i in range(things):
- print("введите имя ",i+1," переменной:")
- chars.append(input())
- print("введите пин ", i+1, " переменной:")
- pins.append(input())
- print("введите тип ", i+1, " переменной:")
- tips.append(input())
- print("введите функцию ", i+1, " переменной:")
- funct.append(input())
- print("как будет использоваться ", i+1, " переменная?")
- work.append(input())
- print("Вот программа:")
- for i in range(things):
- print("int ",chars[i]," = ",pins[i], ";")
- print("void setup(){")
- for i in range(things):
- if(tips[i] == "o"):
- print(" pinMode(",chars[i],"; OUTPUT);")
- elif(tips[i] == "i"):
- print(" pinMode(",chars[i],"; INPUT);")
- print("}")
- print(" void loop(){")
- for i in range(things):
- if (funct[i] == "l"):
- print(" digitalWrite(",chars[i],", HIGH);")
- print(" delay(1000);")
- print(" digitalWrite(", chars[i], ", LOW);")
- print(" delay(1000);")
- print("}")
- Arduino()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement