How can we design an automated system that promotes sustainable consumption while improving customer experience in retail clothing stores?
In 2022, human resources.net conducted a survey on retail manpower shortages. "Two in five (44%) retail employees plan to leave the sector in the next year, citing low salaries (56%), dealing with unreasonable customers (52%), and long working hours (46%)." The lack of manpower in retail can lead to a few things: Longer waiting times for all services such as paying/queries, customers being tired of waiting and leaving the store without buying anything.
Global fiber waste has been increasing rapidly as people pursue fast and trendy fashion which result in unsoldinventory andmore fibre clothing to be disposed when they are out-dated. According to Textile Exchange 2023, In the last 20 years, global fibre production has almost doubled from 58 million tonnes in 2000 to 116 million tonnes in 2022, he fashion industry is the second-biggest consumer of water and is responsible for 2-8% of global carbon emissions.
Project overview:Using M5Stack in clothing stores, customers could select/view the colours, design and sizes of the clothing without having to wait for salesperson to attain to them, while the sale of second life and sustainable material clothing would be highly promoted.
1. Upon the PIR sensor's detection of customer, the M5Stack would turn on and display the menu page to customer.
2. Using a RFID sensor, the M5Stack could detect the unique tag on each clothing and could choose what to display on the M5Stack menu screen (colours, similar designs, sizes etc.). [AUTOMATIC]. Else, the customer could scroll through the category screen to select the main category and followed by specific clothing, by using the ANGLE unit [MANUAL].
3. Upon selection/scanning of the clothing, a 'decision' would pop up on the M5STACK and promote second life clothing with promotion offers.
4. Upon confirmation of the second life clothing/new stock, the colour, size and member mode would be displayed on the M5STACK.
5. Upon selection of the colour or size mode, the customer could toggle on the M5STACK and select the desired ones. Upon selection of member mode, the customer would be prompt to scan his/her member card and his/her membership points would be displayed.
6. Upon selection of the prefered clothing, an alert would be sent to counter (second M5STACK) as it will buzz (BUZZER) and light up(RGB).
- V1_11Jan
- V2_11Jan
- V3_11Jan
- V4_13Jan
- V5_13Jan
- V6_13Jan
- V7_14Jan
- V8_14Jan
- V9_14Jan
- V10_14Jan
- V11_14Jan
- V12_15Jan
- V13_15Jan
- V14_15Jan
- V15_20Jan
- V16_21Jan
- V17_22Jan
- V18_22Jan
- V19_22Jan
- V20_22Jan
- V21_22Jan
- V22_5Feb
- ESPNOW Receive V1
- ESPNOW Receive V2
- ESPNOW Receive V3
- ESPNOW Receive V4
- ESPNOW Receive V5
- V23_10Feb
- V24_10Feb
- V25_10Feb
- V26_10Feb
- V27_11Feb
- V28_11Feb
- V29_11Feb
- V30_11Feb
- V31_11Feb
- V32_11Feb
- V33_11Feb
- V34_11Feb
- V35_11Feb
- V36_11Feb
- V37_11Feb
- V38_12Feb
- V39_13Feb
- ESPNOW Receive V6 [Final - 1]
- V40_14Feb [Final - 2]
V1_11Jan
PythonAdded a function to "wait until Button A is released"
Added a function to "wait until Button B is released"
Added a function to "wait until Button C is released"
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
DesignList = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, DesignList
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, DesignList
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, DesignList
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
DesignList = ['Flannel Shirt', 'Peplum top', 'T-Shirt', 'Henley Shirt', 'Boxy Top', 'Camisole', 'Sleeveless Shirt', 'V-Neck Shirt', 'Crop top', 'Oxford Shirt (formal)', 'Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top', 'Blouse', 'Tube Top', 'Dress Shirt (formal)', 'Cape Top/Batwing Top', 'Raglan', 'Denim Shirt', 'Kaftan', 'Round-Neck Shirt', 'Polo Shirt', 'Wrap Top', 'Pocket Tee', 'Bralette Top', 'Denim Shirt', 'Blouson Top', 'Overshirt', 'Tank Top', 'Chocker Top', 'Linen Shirt', 'Scoop Neck Top', 'Button up Shirt', 'Singlet', 'Cuban Collar Shirt', 'Short Sleeve Shirt', 'Crew Neck Shirt', 'Long Sleeve Shirt', 'Bustier Top', 'Mandarin Collar Shirt']
DesignNumber = 1
label0.hide()
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, DesignList
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, DesignList
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
DesignList = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, DesignList
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, DesignList
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, DesignList
ModeList = ['Design Mode', ' Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
DesignList = ['Design 1', 'Design 2', 'Design 3', 'Design 4', 'Design 5']
DesignNumber = 1
label0.hide()
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, DesignList
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif ' Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, DesignList
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
DesignList = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, DesignList
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, DesignList
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, DesignList
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, DesignList
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
DesignList = ['Flannel Shirt', 'Peplum top', 'T-Shirt', 'Henley Shirt', 'Boxy Top', 'Camisole', 'Sleeveless Shirt', 'V-Neck Shirt', 'Crop top', 'Oxford Shirt (formal)', 'Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top', 'Blouse', 'Tube Top', 'Dress Shirt (formal)', 'Cape Top/Batwing Top', 'Raglan', 'Denim Shirt', 'Kaftan', 'Round-Neck Shirt', 'Polo Shirt', 'Wrap Top', 'Pocket Tee', 'Bralette Top', 'Denim Shirt', 'Blouson Top', 'Overshirt', 'Tank Top', 'Chocker Top', 'Linen Shirt', 'Scoop Neck Top', 'Button up Shirt', 'Singlet', 'Cuban Collar Shirt', 'Short Sleeve Shirt', 'Crew Neck Shirt', 'Long Sleeve Shirt', 'Bustier Top', 'Mandarin Collar Shirt']
DesignNumber = 1
label0.hide()
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, DesignList
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, DesignList
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
TopsList = None
DesignList = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Flannel Shirt', 'Peplum top', 'T-Shirt', 'Henley Shirt', 'Boxy Top', 'Camisole', 'Sleeveless Shirt', 'V-Neck Shirt', 'Crop top', 'Oxford Shirt (formal)', 'Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top', 'Blouse', 'Tube Top', 'Dress Shirt (formal)', 'Cape Top/Batwing Top', 'Raglan', 'Denim Shirt', 'Kaftan', 'Round-Neck Shirt', 'Polo Shirt', 'Wrap Top', 'Pocket Tee', 'Bralette Top', 'Denim Shirt', 'Blouson Top', 'Overshirt', 'Tank Top', 'Chocker Top', 'Linen Shirt', 'Scoop Neck Top', 'Button up Shirt', 'Singlet', 'Cuban Collar Shirt', 'Short Sleeve Shirt', 'Crew Neck Shirt', 'Long Sleeve Shirt', 'Bustier Top', 'Mandarin Collar Shirt']
DesignList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = 0
DesignNumber = 1
label0.hide()
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
TopsList = None
DesignList = None
BottomsList = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnC.isPressed():
pass
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Flannel Shirt', 'Peplum top', 'T-Shirt', 'Henley Shirt', 'Boxy Top', 'Camisole', 'Sleeveless Shirt', 'V-Neck Shirt', 'Crop top', 'Oxford Shirt (formal)', 'Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top', 'Blouse', 'Tube Top', 'Dress Shirt (formal)', 'Cape Top/Batwing Top', 'Raglan', 'Denim Shirt', 'Kaftan', 'Round-Neck Shirt', 'Polo Shirt', 'Wrap Top', 'Pocket Tee', 'Bralette Top', 'Denim Shirt', 'Blouson Top', 'Overshirt', 'Tank Top', 'Chocker Top', 'Linen Shirt', 'Scoop Neck Top', 'Button up Shirt', 'Singlet', 'Cuban Collar Shirt', 'Short Sleeve Shirt', 'Crew Neck Shirt', 'Long Sleeve Shirt', 'Bustier Top', 'Mandarin Collar Shirt']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int(len(DesignList) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int((len(DesignList) - len(TopsList)) - 1)])
DesignNumber = 1
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
DesignNumber = None
ModeNumber = None
TopsList = None
DesignList = None
BottomsList = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
while btnC.isPressed():
pass
# Describe this function...
def Gameloop():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Startup():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int(len(DesignList) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int((len(DesignList) - len(TopsList)) - 1)])
DesignNumber = 1
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, DesignNumber, ModeNumber, TopsList, DesignList, BottomsList, i
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
ModeList = None
ModeNumber = None
DesignNumber = None
TopsList = None
DesignList = None
BottomsList = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label0 = M5TextBox(74, 101, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Mode_Name():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
while btnC.isPressed():
pass
# Describe this function...
def Gameloop():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
label0.hide()
# Describe this function...
def Refresh_Design_Number():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
label0.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Startup():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int((len(DesignList) + 1) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int(((len(DesignList) - len(TopsList)) + 1) - 1)])
DesignNumber = 1
label0.hide()
# Describe this function...
def Design_mode():
global ModeList, ModeNumber, DesignNumber, TopsList, DesignList, BottomsList, i
label0.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
SizeList = None
DesignNumber = None
SizeNumber = None
ModeNumber = None
ModeList = None
DesignList = None
TopsList = None
BottomsList = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Refresh_Design_Number():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
SizeList = ['3XS', '2XS', 'XS', 'S', 'M', 'L', 'XL', '2XL', '3XL']
SizeNumber = 5
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int((len(DesignList) + 1) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int(((len(DesignList) - len(TopsList)) + 1) - 1)])
DesignNumber = 1
DesignName.hide()
SizeName.hide()
Refresh_Design_Number()
Refresh_Size_Number()
# Describe this function...
def Refresh_Mode_Name():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Gameloop():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
# Describe this function...
def Design_mode():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Size_Mode():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Refresh_Size_Number():
global SizeList, DesignNumber, SizeNumber, ModeNumber, ModeList, DesignList, TopsList, BottomsList, i
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
setScreenColor(0x222222)
SizeList = None
SizeNumber = None
ModeNumber = None
DesignNumber = None
ModeList = None
DesignList = None
TopsList = None
BottomsList = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Gameloop():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
# Describe this function...
def Refresh_Mode_Name():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnB.isPressed():
pass
# Describe this function...
def Refresh_Size_Number():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
while btnC.isPressed():
pass
# Describe this function...
def Refresh_Design_Number():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Startup():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
SizeList = ['3XS', '2XS', 'XS', 'S', 'M', 'L', 'XL', '2XL', '3XL']
SizeNumber = 5
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int((len(DesignList) + 1) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int(((len(DesignList) - len(TopsList)) + 1) - 1)])
DesignNumber = 1
DesignName.hide()
SizeName.hide()
Refresh_Design_Number()
Refresh_Size_Number()
LeftButton.setText('Mode')
MidButton.setText(str('-'))
RightButton.setText('+')
# Describe this function...
def Design_mode():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Size_Mode():
global SizeList, ModeNumber, SizeNumber, DesignNumber, ModeList, DesignList, TopsList, BottomsList, i
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
SizeNumber = None
ModeNumber = None
DesignNumber = None
ColorNumber = None
ModeList = None
DesignList = None
ColorList = None
TopsList = None
BottomsList = None
RedColor = None
GreenColor = None
BlueColor = None
i = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(62, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(233, 112, 50, 50, 0xFFFFFF, 0xFFFFFF)
Green = M5Rect(233, 57, 50, 50, 0xFFFFFF, 0xFFFFFF)
Red = M5Rect(176, 57, 50, 50, 0xFFFFFF, 0xFFFFFF)
Blue = M5Rect(176, 112, 50, 50, 0xFFFFFF, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Refresh_Design_Number():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Design_mode():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Refresh_Mode_Name():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
SizeList = ['3XS', '2XS', 'XS', 'S', 'M', 'L', 'XL', '2XL', '3XL']
SizeNumber = 5
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Location Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int((len(DesignList) + 1) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int(((len(DesignList) - len(TopsList)) + 1) - 1)])
DesignNumber = 1
ColorList = ['Red', 'Green', 'Blue']
ColorNumber = 1
RedColor = 1
GreenColor = 1
BlueColor = 1
DesignName.hide()
SizeName.hide()
Refresh_Design_Number()
Refresh_Size_Number()
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
# Describe this function...
def Gameloop():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 255)))
# Describe this function...
def Refresh_Size_Number():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Size_Mode():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Color_Mode():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, DesignNumber, ModeNumber, SizeNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, RedColor, GreenColor, BlueColor, i
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
SizeNumber = None
ModeNumber = None
DesignNumber = None
ColorNumber = None
ModeList = None
DesignList = None
ColorList = None
TopsList = None
BottomsList = None
i = None
RedColor = None
GreenColor = None
BlueColor = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(65, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(162, 170, 50, 50, 0x000000, 0xFFFFFF)
Green = M5Rect(54, 170, 50, 50, 0x000000, 0xFFFFFF)
Red = M5Rect(0, 170, 50, 50, 0x000000, 0xFFFFFF)
Blue = M5Rect(108, 170, 50, 50, 0x000000, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(256, 93, 226, 123, 285, 123, 0x918585, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def Startup():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
SizeList = ['3XS', '2XS', 'XS', 'S', 'M', 'L', 'XL', '2XL', '3XL']
SizeNumber = 5
ModeList = ['Design Mode', 'Size Mode', 'Color Mode', 'Member Mode']
ModeNumber = 1
TopsList = ['Blouse', 'Blouson Top', 'Boxy Top', 'Bralette Top', 'Bustier Top', 'Button up Shirt', 'Camisole', 'Cape Top/Batwing Top', 'Chocker Top', 'Cold Shoulder Top', 'Crew Neck Shirt', 'Crop top', 'Cuban Collar Shirt', 'Denim Shirt', 'Denim Shirt', 'Dress Shirt (formal)', 'Flannel Shirt', 'Henley Shirt', 'Kaftan', 'Linen Shirt', 'Long Sleeve Shirt', 'Mandarin Collar Shirt', 'Off Shoulder Top', 'One Shoulder Top', 'Overshirt', 'Oxford Shirt (formal)', 'Pocket Tee', 'Polo Shirt', 'Peplum top', 'Raglan', 'Round-Neck Shirt', 'Scoop Neck Top', 'Singlet', 'Short Sleeve Shirt', 'Sleeveless Shirt', 'Tank Top', 'Tube Top', 'T-Shirt', 'V-Neck Shirt', 'Wrap Top']
BottomsList = ['Bell Bottoms', 'Cargo Pants/Utility Pants', 'Chinos', 'Capri pants', 'Cycling shorts', 'Capri Pants', 'Cutoffs', 'Denim Skirt', 'Drawstring Pants', 'Dress Pants', 'Drop-crotch Pants', 'Dungarees/Overalls', 'Flare Jeans/Pants', 'Flared Skirt', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'High-waisted Pants/Shorts', 'Hot Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jodhpur Pants', 'Joggers', 'Jorts/(Jean Shorts)', 'Khakis', 'Knee-length Shorts', 'Leather Pants/Leggings', 'Leggings', 'Linen Pants/Shorts', 'Lounge Pants', 'Low-rise Jeans', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Motorcycle Pants', 'Parachute pants', 'Palazzo pants', 'Pocket Tee', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Quilted Shorts', 'Ripped Jeans', 'Romper', 'Sarong', 'Sequin Pants', 'Shorts', 'Side-slit Skirt', 'Silk Pants', 'Skirt', 'Skort', 'Slacks', 'Slim-fit Pants', 'Slit-front Pants', 'Straight-leg Jeans/Pants', 'Suspender Pants', 'Sweatpants', 'Tapered Leggings/Pants', 'Track Pants', 'Trousers', 'Tulle Skirt', 'Velour Pants', 'Velvet Leggings', 'Wide-leg Culottes/Jumpsuit/Pants', 'Yoga Pants/Shorts', 'Zipper Pants', 'Zipper Skirt']
DesignList = []
for i in TopsList:
DesignList.append(TopsList[int((len(DesignList) + 1) - 1)])
for i in BottomsList:
DesignList.append(BottomsList[int(((len(DesignList) - len(TopsList)) + 1) - 1)])
DesignNumber = 1
ColorList = ['Red', 'Green', 'Blue']
ColorNumber = 1
RedColor = 1
GreenColor = 1
BlueColor = 1
DesignName.hide()
SizeName.hide()
Refresh_Design_Number()
Refresh_Size_Number()
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
# Describe this function...
def Refresh_Size_Number():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
while btnC.isPressed():
pass
# Describe this function...
def Refresh_Design_Number():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Gameloop():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
Design_mode()
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
try :
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 255)))
pass
except:
pass
# Describe this function...
def Design_mode():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Size_Mode():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Color_Mode():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('Color')
RightButton.setText('Set')
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, SizeNumber, ModeNumber, DesignNumber, ColorNumber, ModeList, DesignList, ColorList, TopsList, BottomsList, i, RedColor, GreenColor, BlueColor
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
TopsList = None
BottomsList = None
SizeNumber = None
TopsCategory = None
DesignList = None
j = None
ModeNumber = None
ModeList = None
DesignNumber = None
BottomsCategory = None
i = None
ColorNumber = None
DataTopsList = None
_number = None
ColorList = None
RedColor = None
GreenColor = None
BlueColor = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(65, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(162, 170, 50, 50, 0x000000, 0xFFFFFF)
Green = M5Rect(54, 170, 50, 50, 0x000000, 0xFFFFFF)
Red = M5Rect(0, 170, 50, 50, 0x000000, 0xFFFFFF)
Blue = M5Rect(108, 170, 50, 50, 0x000000, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(256, 93, 226, 123, 285, 123, 0x918585, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def Refresh_Design_Number():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Size_Number():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
while btnC.isPressed():
pass
# Describe this function...
def Gameloop():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
pass
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
try :
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 255)))
pass
except:
pass
# Describe this function...
def Design_mode():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Startup():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
DataTopsList = 'Mandarin Collar Shirt - Shirts (Collared & Buttoned)'
# Describe this function...
def Size_Mode():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Fill_Data_Tops():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
j = 1
for j in DataTopsList:
_number = ''.count([][0])
# Describe this function...
def Color_Mode():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('Color')
RightButton.setText('Set')
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, TopsList, BottomsList, SizeNumber, TopsCategory, DesignList, j, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, DataTopsList, _number, ColorList, RedColor, GreenColor, BlueColor
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
Startup()
while True:
Mode.setText(str(_number))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
TopsList = None
BottomsList = None
_number = None
j = None
DataTopsList = None
Countletter = None
SizeNumber = None
TopsCategory = None
DesignList = None
CountNumber = None
DesignNumber = None
ModeNumber = None
ModeList = None
BottomsCategory = None
i = None
ColorNumber = None
_number2 = None
Repeattimes = None
ColorList = None
RedColor = None
GreenColor = None
BlueColor = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(65, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(162, 170, 50, 50, 0x000000, 0xFFFFFF)
Green = M5Rect(54, 170, 50, 50, 0x000000, 0xFFFFFF)
Red = M5Rect(0, 170, 50, 50, 0x000000, 0xFFFFFF)
Blue = M5Rect(108, 170, 50, 50, 0x000000, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(256, 93, 226, 123, 285, 123, 0x918585, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def Refresh_Size_Number():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Refresh_Design_Number():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
while btnC.isPressed():
pass
# Describe this function...
def Gameloop():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
Refresh_Mode_Name()
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
pass
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
try :
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 255)))
pass
except:
pass
# Describe this function...
def Startup():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
DataTopsList = ['Mandarin Collar Shirt - Shirts (Collared & Buttoned)']
TopsList = []
Fill_Data_Tops()
# Describe this function...
def Design_mode():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Size_Mode():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Color_Mode():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
LeftButton.setText('Mode')
MidButton.setText('Color')
RightButton.setText('Set')
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
# Describe this function...
def Fill_Data_Tops():
global SizeList, TopsList, BottomsList, _number, j, DataTopsList, Countletter, SizeNumber, TopsCategory, DesignList, CountNumber, DesignNumber, ModeNumber, ModeList, BottomsCategory, i, ColorNumber, _number2, Repeattimes, ColorList, RedColor, GreenColor, BlueColor
CountNumber = 1
_number2 = ''
_number = ''
for i in DataTopsList:
Countletter = 1
_number = DataTopsList[int(CountNumber - 1)]
while not '-' == _number[0]:
_number2 = (str(_number2) + str(_number[0]))
_number = _number.lstrip(_number[0])
DesignName.setText(str(_number2))
Startup()
while True:
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
BottomsList = None
DesignList = None
SizeNumber = None
TopsCategory = None
i = None
DesignNumber = None
ModeNumber = None
ModeList = None
BottomsCategory = None
ColorNumber = None
TopsList = None
Shirts_Collared_Buttoned_ = None
ColorList = None
T_ShirtsandCasualTops = None
SleevelessTops = None
RedColor = None
CropTopsandTrendyStyles = None
GreenColor = None
FormalandDressyTops = None
BlueColor = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(65, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(162, 170, 50, 50, 0x000000, 0xFFFFFF)
Green = M5Rect(54, 170, 50, 50, 0x000000, 0xFFFFFF)
Red = M5Rect(0, 170, 50, 50, 0x000000, 0xFFFFFF)
Blue = M5Rect(108, 170, 50, 50, 0x000000, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(256, 93, 226, 123, 285, 123, 0x918585, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def Refresh_Size_Number():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Refresh_Design_Number():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = 0
CasualPants = 0
SkirtsandSkorts = 0
Shorts = 0
FormalandWorkwear = 0
SpecialtyPantsandJumpsuits = 0
AthleisureandLeggings = 0
OtherSpecialtyBottoms = 0
# Describe this function...
def Design_mode():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Gameloop():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
pass
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 100)))
# Describe this function...
def Size_Mode():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Color_Mode():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
LeftButton.setText('Mode')
MidButton.setText('Color')
RightButton.setText('Set')
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, BottomsList, DesignList, SizeNumber, TopsCategory, i, DesignNumber, ModeNumber, ModeList, BottomsCategory, ColorNumber, TopsList, Shirts_Collared_Buttoned_, ColorList, T_ShirtsandCasualTops, SleevelessTops, RedColor, CropTopsandTrendyStyles, GreenColor, FormalandDressyTops, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
Startup()
while True:
wait_ms(2)
V15_20Jan
Pythonfrom m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
SizeNumber = None
TopsCategory = None
CasualPants = None
ModeNumber = None
ModeList = None
DesignNumber = None
BottomsCategory = None
SkirtsandSkorts = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
Shorts = None
ColorList = None
DesignList = None
T_ShirtsandCasualTops = None
FormalandWorkwear = None
SleevelessTops = None
SpecialtyPantsandJumpsuits = None
RedColor = None
CropTopsandTrendyStyles = None
AthleisureandLeggings = None
GreenColor = None
FormalandDressyTops = None
OtherSpecialtyBottoms = None
BlueColor = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
Mode = M5TextBox(98, 20, "Mode", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
Mod = M5TextBox(14, 20, "Mode:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
DesignName = M5TextBox(74, 57, "Design", lcd.FONT_Default, 0xFFFFFF, rotate=0)
SizeName = M5TextBox(54, 86, "Size", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Desig = M5TextBox(14, 57, "Design:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Siz = M5TextBox(14, 86, "Size:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
LeftButton = M5TextBox(48, 224, "Left", lcd.FONT_Default, 0xFFFFFF, rotate=0)
MidButton = M5TextBox(147, 224, "Mid", lcd.FONT_Default, 0xFFFFFF, rotate=0)
RightButton = M5TextBox(233, 224, "Right", lcd.FONT_Default, 0xFFFFFF, rotate=0)
Angl = M5TextBox(14, 112, "Angle:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
AngleNumber = M5TextBox(65, 112, "Angle", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ALLRGB = M5Rect(162, 170, 50, 50, 0x000000, 0xFFFFFF)
Green = M5Rect(54, 170, 50, 50, 0x000000, 0xFFFFFF)
Red = M5Rect(0, 170, 50, 50, 0x000000, 0xFFFFFF)
Blue = M5Rect(108, 170, 50, 50, 0x000000, 0xFFFFFF)
Colo = M5TextBox(14, 136, "Color:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
ColorName = M5TextBox(64, 136, "Color", lcd.FONT_Default, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(256, 93, 226, 123, 285, 123, 0x918585, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def Refresh_Design_Number():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if DesignNumber >= len(DesignList) + 1:
DesignNumber = 1
elif DesignNumber <= 0:
DesignNumber = len(DesignList)
DesignName.setText(str(DesignList[int(DesignNumber - 1)]))
# Describe this function...
def Refresh_Mode_Name():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if ModeNumber >= len(ModeList) + 1:
ModeNumber = 1
Mode.setText(str(ModeList[int(ModeNumber - 1)]))
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Refresh_Size_Number():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if SizeNumber >= len(SizeList) + 1:
SizeNumber = len(SizeList)
elif SizeNumber <= 0:
SizeNumber = 1
SizeName.setText(str(SizeList[int(SizeNumber - 1)]))
# Describe this function...
def Startup():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Design_mode():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Design_Number()
if btnB.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + -1
Refresh_Design_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
DesignNumber = (DesignNumber if isinstance(DesignNumber, Number) else 0) + 1
Refresh_Design_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if btnA.isPressed():
ModeNumber = (ModeNumber if isinstance(ModeNumber, Number) else 0) + 1
Refresh_Mode_Name()
Wait_until_A_is_Realeased()
if 'Design Mode' == ModeList[int(ModeNumber - 1)]:
pass
elif 'Size Mode' == ModeList[int(ModeNumber - 1)]:
Size_Mode()
elif 'Color Mode' == ModeList[int(ModeNumber - 1)]:
Color_Mode()
elif 'Location Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
elif 'Member Mode' == ModeList[int(ModeNumber - 1)]:
DesignName.hide()
SizeName.hide()
AngleNumber.setText(str(round((((angle_0.read()) - 20) / 1024) * 100)))
# Describe this function...
def Size_Mode():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
LeftButton.setText('Mode')
MidButton.setText('-')
RightButton.setText('+')
DesignName.show()
SizeName.show()
Refresh_Size_Number()
if btnB.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + -1
Refresh_Size_Number()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
SizeNumber = (SizeNumber if isinstance(SizeNumber, Number) else 0) + 1
Refresh_Size_Number()
Wait_until_C_is_Realeased()
# Describe this function...
def Color_Mode():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
LeftButton.setText('Mode')
MidButton.setText('Color')
RightButton.setText('Set')
Refresh_Color_Name()
DesignName.show()
SizeName.show()
if btnB.isPressed():
ColorNumber = (ColorNumber if isinstance(ColorNumber, Number) else 0) + 1
Refresh_Color_Name()
Wait_until_B_is_Realeased()
if btnC.isPressed():
if 'Red' == ColorList[int(ColorNumber - 1)]:
RedColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Green' == ColorList[int(ColorNumber - 1)]:
GreenColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
elif 'Blue' == ColorList[int(ColorNumber - 1)]:
BlueColor = round(((int((angle_0.read())) - 20) / 1024) * 255)
Red.setBgColor((RedColor << 16) | (0 << 8) | 0)
Green.setBgColor((0 << 16) | (GreenColor << 8) | 0)
Blue.setBgColor((0 << 16) | (0 << 8) | BlueColor)
ALLRGB.setBgColor((RedColor << 16) | (GreenColor << 8) | BlueColor)
# Describe this function...
def Refresh_Color_Name():
global SizeList, JeansandDenim, SizeNumber, TopsCategory, CasualPants, DesignNumber, ModeNumber, ModeList, BottomsCategory, SkirtsandSkorts, ColorNumber, Shirts_Collared_Buttoned_, Shorts, DesignList, ColorList, T_ShirtsandCasualTops, FormalandWorkwear, SleevelessTops, SpecialtyPantsandJumpsuits, RedColor, CropTopsandTrendyStyles, AthleisureandLeggings, GreenColor, FormalandDressyTops, OtherSpecialtyBottoms, BlueColor, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if ColorNumber >= len(ColorList) + 1:
ColorNumber = 1
ColorName.setText(str(ColorList[int(ColorNumber - 1)]))
Startup()
while True:
wait_ms(2)
V16_21Jan
Pythonfrom m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
SizeNumber = None
CasualPants = None
ModeList = None
SkirtsandSkorts = None
ModeNumber = None
TopsCategory = None
Shorts = None
ColorList = None
BottomsCategory = None
FormalandWorkwear = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
SpecialtyPantsandJumpsuits = None
RedColor = None
T_ShirtsandCasualTops = None
AthleisureandLeggings = None
GreenColor = None
SleevelessTops = None
OtherSpecialtyBottoms = None
BlueColor = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(59, 25, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label2 = M5TextBox(59, 83, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label3 = M5TextBox(219, 83, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label4 = M5TextBox(59, 141, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label5 = M5TextBox(219, 141, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label6 = M5TextBox(59, 199, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(219, 199, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label1 = M5TextBox(219, 25, "label0", lcd.FONT_Default, 0xFFFFFF, rotate=0)
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Scan_item_Mode()
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Startup():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
pass
# Describe this function...
def HallS9():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def HallLabel():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hall():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def SallLabel():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, ModeNumber, TopsCategory, Shorts, ColorList, BottomsCategory, FormalandWorkwear, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, GreenColor, SleevelessTops, OtherSpecialtyBottoms, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
SizeNumber = None
CasualPants = None
ModeList = None
SkirtsandSkorts = None
Selectionnumber = None
categorylabel0 = None
ModeNumber = None
TopsCategory = None
Shorts = None
categorylabel1 = None
ColorList = None
BottomsCategory = None
FormalandWorkwear = None
categorylabel2 = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
SpecialtyPantsandJumpsuits = None
categorylabel3 = None
RedColor = None
T_ShirtsandCasualTops = None
AthleisureandLeggings = None
categorylabel4 = None
GreenColor = None
SleevelessTops = None
OtherSpecialtyBottoms = None
categorylabel5 = None
BlueColor = None
CropTopsandTrendyStyles = None
categorylabel6 = None
FormalandDressyTops = None
categorylabel7 = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(10, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label2 = M5TextBox(10, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label3 = M5TextBox(170, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label4 = M5TextBox(10, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label5 = M5TextBox(170, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label6 = M5TextBox(10, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(170, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label1 = M5TextBox(170, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Choose_Category():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Wait_until_A_is_Realeased()
rectangle9.setPosition(0, 3)
Selectionnumber = 1
categorylabel0 = 'Shirts (Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual Tops'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy Styles'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder Styles'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
HallS9()
UpdateLabel0_7()
SallLabel()
while not (btnA.isPressed()):
if btnB.isPressed():
Selectionnumber = (Selectionnumber if isinstance(Selectionnumber, Number) else 0) + -1
dosomething()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
Selectionnumber = (Selectionnumber if isinstance(Selectionnumber, Number) else 0) + 1
dosomething()
Wait_until_C_is_Realeased()
Hall()
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
pass
# Describe this function...
def Startup():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Scan_item_Mode()
if btnA.isPressed():
Choose_Category()
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def HallS9():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def HallLabel():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hall():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def dosomething():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if 16 < Selectionnumber:
Selectionnumber = 1
if 1 > Selectionnumber:
Selectionnumber = 16
if 9 > Selectionnumber:
if Selectionnumber == 1:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 2:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 3:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 4:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 5:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 6:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 7:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 8:
rectangle9.setPosition(160, 180)
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
HallS9()
UpdateLabel0_7()
SallLabel()
else:
if Selectionnumber == 9:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 10:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 11:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 12:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 13:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 14:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 15:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 16:
rectangle9.setPosition(160, 180)
categorylabel0 = 'Jeans and Denim'
categorylabel1 = 'Casual Pants'
categorylabel2 = 'Skirts and Skorts'
categorylabel3 = 'Shorts'
categorylabel4 = 'Formal and Workwear'
categorylabel5 = 'Specialty Pants and Jumpsuits'
categorylabel6 = 'Athleisure and Leggings'
categorylabel7 = 'Other Specialty Bottoms'
HallS9()
UpdateLabel0_7()
SallLabel()
# Describe this function...
def SallLabel():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
# Describe this function...
def UpdateLabel0_7():
global SizeList, JeansandDenim, SizeNumber, CasualPants, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel0, ModeNumber, TopsCategory, Shorts, categorylabel1, ColorList, BottomsCategory, FormalandWorkwear, categorylabel2, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel3, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel4, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel5, BlueColor, CropTopsandTrendyStyles, categorylabel6, FormalandDressyTops, categorylabel7, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.setText(str(categorylabel0))
label1.setText(str(categorylabel1))
label2.setText(str(categorylabel2))
label3.setText(str(categorylabel3))
label4.setText(str(categorylabel4))
label5.setText(str(categorylabel5))
label6.setText(str(categorylabel6))
label7.setText(str(categorylabel7))
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
SizeNumber = None
categorylabel0 = None
CasualPants = None
ModeList = None
categorylabel1 = None
SkirtsandSkorts = None
Selectionnumber = None
ModeNumber = None
TopsCategory = None
categorylabel2 = None
Shorts = None
ColorList = None
BottomsCategory = None
categorylabel3 = None
FormalandWorkwear = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
categorylabel4 = None
SpecialtyPantsandJumpsuits = None
RedColor = None
T_ShirtsandCasualTops = None
categorylabel5 = None
AthleisureandLeggings = None
GreenColor = None
SleevelessTops = None
categorylabel6 = None
OtherSpecialtyBottoms = None
BlueColor = None
CropTopsandTrendyStyles = None
categorylabel7 = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
label8 = M5TextBox(149, 88, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(10, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label2 = M5TextBox(10, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label3 = M5TextBox(170, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label4 = M5TextBox(10, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label5 = M5TextBox(170, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label6 = M5TextBox(10, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(170, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label1 = M5TextBox(170, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def LabelNameTop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
pass
# Describe this function...
def Startup():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Scan_item_Mode()
label8.setText('Hello M5')
if btnA.isPressed():
label8.hide()
Choose_Category()
label8.show()
# Describe this function...
def Choose_Category():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Wait_until_A_is_Realeased()
rectangle9.setPosition(0, 3)
Selectionnumber = 1
LabelNameTop()
HallS9()
UpdateLabel0_7()
SallLabel()
while not (btnA.isPressed()):
if btnB.isPressed():
Selectionnumber = (Selectionnumber if isinstance(Selectionnumber, Number) else 0) + -1
Hilight_Selection()
Wait_until_B_is_Realeased()
elif btnC.isPressed():
Selectionnumber = (Selectionnumber if isinstance(Selectionnumber, Number) else 0) + 1
Hilight_Selection()
Wait_until_C_is_Realeased()
Hall()
HallLabel()
Wait_until_A_is_Realeased()
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def HallS9():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def LabelNameBottom():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = 'Jeans and Denim'
categorylabel1 = 'Casual Pants'
categorylabel2 = 'Skirts and Skorts'
categorylabel3 = 'Shorts'
categorylabel4 = 'Formal and Workwear'
categorylabel5 = 'Specialty Pants and Jumpsuits'
categorylabel6 = 'Athleisure and Leggings'
categorylabel7 = 'Other Specialty Bottoms'
# Describe this function...
def HallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hilight_Selection():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
if 16 < Selectionnumber:
Selectionnumber = 1
if 1 > Selectionnumber:
Selectionnumber = 16
if 9 > Selectionnumber:
if Selectionnumber == 1:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 2:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 3:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 4:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 5:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 6:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 7:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 8:
rectangle9.setPosition(160, 180)
LabelNameTop()
HallS9()
UpdateLabel0_7()
SallLabel()
else:
if Selectionnumber == 9:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 10:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 11:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 12:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 13:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 14:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 15:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 16:
rectangle9.setPosition(160, 180)
LabelNameBottom()
HallS9()
UpdateLabel0_7()
SallLabel()
# Describe this function...
def Hall():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def SallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
# Describe this function...
def UpdateLabel0_7():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, Selectionnumber, categorylabel2, ModeNumber, TopsCategory, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.setText(str(categorylabel0))
label1.setText(str(categorylabel1))
label2.setText(str(categorylabel2))
label3.setText(str(categorylabel3))
label4.setText(str(categorylabel4))
label5.setText(str(categorylabel5))
label6.setText(str(categorylabel6))
label7.setText(str(categorylabel7))
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
categorylabel0 = None
SizeNumber = None
CasualPants = None
categorylabel1 = None
ModeList = None
SkirtsandSkorts = None
categorylabel2 = None
Selectionnumber = None
ModeNumber = None
TopsCategory = None
Shorts = None
categorylabel3 = None
ColorList = None
BottomsCategory = None
FormalandWorkwear = None
categorylabel4 = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
SpecialtyPantsandJumpsuits = None
categorylabel5 = None
RedColor = None
T_ShirtsandCasualTops = None
AthleisureandLeggings = None
categorylabel6 = None
GreenColor = None
SleevelessTops = None
OtherSpecialtyBottoms = None
categorylabel7 = None
BlueColor = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
label8 = M5TextBox(149, 88, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(10, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label2 = M5TextBox(10, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label3 = M5TextBox(170, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label4 = M5TextBox(10, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label5 = M5TextBox(170, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label6 = M5TextBox(10, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(170, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label1 = M5TextBox(170, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
import math
# Describe this function...
def LabelNameBottom():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = 'Jeans and Denim'
categorylabel1 = 'Casual Pants'
categorylabel2 = 'Skirts and Skorts'
categorylabel3 = 'Shorts'
categorylabel4 = 'Formal and Workwear'
categorylabel5 = 'Specialty Pants and Jumpsuits'
categorylabel6 = 'Athleisure and Leggings'
categorylabel7 = 'Other Specialty Bottoms'
# Describe this function...
def LabelNameTop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
pass
# Describe this function...
def Startup():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Scan_item_Mode()
label8.setText('Hello M5')
if btnA.isPressed():
label8.hide()
Choose_Category()
label8.show()
# Describe this function...
def Choose_Category():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Wait_until_A_is_Realeased()
rectangle9.setPosition(0, 3)
Selectionnumber = 1
LabelNameTop()
HallS9()
UpdateLabel0_7()
SallLabel()
while not (btnA.isPressed()):
if btnC.isPressed():
if 9 > Selectionnumber:
if Selectionnumber == 1:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 2:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 3:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 4:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 5:
pass
elif Selectionnumber == 6:
pass
elif Selectionnumber == 7:
pass
elif Selectionnumber == 8:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
else:
if Selectionnumber == 9:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 10:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 11:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 12:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 13:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 14:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 15:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 16:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
if math.ceil(((angle_0.read()) / 1024) * 16 + 0) != Selectionnumber:
Selectionnumber = math.ceil(((angle_0.read()) / 1024) * 16 + 0)
if 9 > Selectionnumber:
if Selectionnumber == 1:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 2:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 3:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 4:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 5:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 6:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 7:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 8:
rectangle9.setPosition(160, 180)
LabelNameTop()
Sall()
UpdateLabel0_7()
SallLabel()
else:
if Selectionnumber == 9:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 10:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 11:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 12:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 13:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 14:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 15:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 16:
rectangle9.setPosition(160, 180)
LabelNameBottom()
Sall()
UpdateLabel0_7()
SallLabel()
Hall()
HallLabel()
Wait_until_A_is_Realeased()
# Describe this function...
def HallS9():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def HallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hall():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def SallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
# Describe this function...
def UpdateLabel0_7():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.setText(str(categorylabel0))
label1.setText(str(categorylabel1))
label2.setText(str(categorylabel2))
label3.setText(str(categorylabel3))
label4.setText(str(categorylabel4))
label5.setText(str(categorylabel5))
label6.setText(str(categorylabel6))
label7.setText(str(categorylabel7))
# Describe this function...
def Sall():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, CasualPants, categorylabel1, ModeList, SkirtsandSkorts, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, Shorts, categorylabel3, ColorList, BottomsCategory, FormalandWorkwear, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, T_ShirtsandCasualTops, AthleisureandLeggings, categorylabel6, GreenColor, SleevelessTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.show()
rectangle1.show()
rectangle3.show()
rectangle4.show()
rectangle5.show()
rectangle6.show()
rectangle7.show()
rectangle8.show()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
JeansandDenim = None
categorylabel0 = None
SizeNumber = None
Shirts_Collared_Buttoned_ = None
CasualPants = None
categorylabel1 = None
ModeList = None
T_ShirtsandCasualTops = None
SkirtsandSkorts = None
Selectionnumber = None
categorylabel2 = None
ModeNumber = None
TopsCategory = None
SleevelessTops = None
Shorts = None
categorylabel3 = None
ColorList = None
BottomsCategory = None
CropTopsandTrendyStyles = None
FormalandWorkwear = None
categorylabel4 = None
ColorNumber = None
FormalandDressyTops = None
SpecialtyPantsandJumpsuits = None
categorylabel5 = None
RedColor = None
FashionableShoulderStyles = None
AthleisureandLeggings = None
categorylabel6 = None
GreenColor = None
SpecialtyTops = None
OtherSpecialtyBottoms = None
categorylabel7 = None
BlueColor = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
label8 = M5TextBox(149, 88, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(10, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label2 = M5TextBox(10, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label3 = M5TextBox(170, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label4 = M5TextBox(10, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label5 = M5TextBox(170, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label6 = M5TextBox(10, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(170, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label1 = M5TextBox(170, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
import math
# Describe this function...
def LabelNameTop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
# Describe this function...
def Choose_Category():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
Wait_until_A_is_Realeased()
rectangle9.setPosition(0, 3)
Selectionnumber = 1
LabelNameTop()
Sall()
UpdateLabel0_7()
SallLabel()
while not (btnA.isPressed()):
if btnC.isPressed():
if 9 > Selectionnumber:
if Selectionnumber == 1:
categorylabel0 = 'Mandarin Collar Shirt'
categorylabel1 = 'Button up Shirt'
categorylabel2 = 'Oxford Shirt (formal)'
categorylabel3 = 'Dress Shirt (formal)'
categorylabel4 = 'Cuban Collar Shirt'
categorylabel5 = 'Linen Shirt'
categorylabel6 = 'Flannel Shirt'
categorylabel7 = 'Denim Shirt'
elif Selectionnumber == 2:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 3:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 4:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 5:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 6:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 7:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 8:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
else:
if Selectionnumber == 9:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 10:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 11:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 12:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 13:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 14:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 15:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
elif Selectionnumber == 16:
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
if math.ceil(((angle_0.read()) / 1024) * 16 + 0) != Selectionnumber:
Selectionnumber = math.ceil(((angle_0.read()) / 1024) * 16 + 0)
if 9 > Selectionnumber:
if Selectionnumber == 1:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 2:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 3:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 4:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 5:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 6:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 7:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 8:
rectangle9.setPosition(160, 180)
LabelNameTop()
Sall()
UpdateLabel0_7()
SallLabel()
else:
if Selectionnumber == 9:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 10:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 11:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 12:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 13:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 14:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 15:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 16:
rectangle9.setPosition(160, 180)
LabelNameBottom()
Sall()
UpdateLabel0_7()
SallLabel()
Hall()
HallLabel()
Wait_until_A_is_Realeased()
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
pass
# Describe this function...
def Startup():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt', 'Overshirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
# Describe this function...
def Gameloop():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
Scan_item_Mode()
label8.setText('Hello M5')
if btnA.isPressed():
label8.hide()
Choose_Category()
label8.show()
# Describe this function...
def LabelNameBottom():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
categorylabel0 = 'Jeans and Denim'
categorylabel1 = 'Casual Pants'
categorylabel2 = 'Skirts and Skorts'
categorylabel3 = 'Shorts'
categorylabel4 = 'Formal and Workwear'
categorylabel5 = 'Specialty Pants and Jumpsuits'
categorylabel6 = 'Athleisure and Leggings'
categorylabel7 = 'Other Specialty Bottoms'
# Describe this function...
def HallS9():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def HallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hall():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def SallLabel():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
# Describe this function...
def UpdateLabel0_7():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
label0.setText(str(categorylabel0))
label1.setText(str(categorylabel1))
label2.setText(str(categorylabel2))
label3.setText(str(categorylabel3))
label4.setText(str(categorylabel4))
label5.setText(str(categorylabel5))
label6.setText(str(categorylabel6))
label7.setText(str(categorylabel7))
# Describe this function...
def Sall():
global SizeList, JeansandDenim, categorylabel0, SizeNumber, Shirts_Collared_Buttoned_, CasualPants, categorylabel1, ModeList, T_ShirtsandCasualTops, SkirtsandSkorts, categorylabel2, Selectionnumber, ModeNumber, TopsCategory, SleevelessTops, Shorts, categorylabel3, ColorList, BottomsCategory, CropTopsandTrendyStyles, FormalandWorkwear, categorylabel4, ColorNumber, FormalandDressyTops, SpecialtyPantsandJumpsuits, categorylabel5, RedColor, FashionableShoulderStyles, AthleisureandLeggings, categorylabel6, GreenColor, SpecialtyTops, OtherSpecialtyBottoms, categorylabel7, BlueColor, PolosandActivewear
rectangle9.show()
rectangle2.show()
rectangle1.show()
rectangle3.show()
rectangle4.show()
rectangle5.show()
rectangle6.show()
rectangle7.show()
rectangle8.show()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x221e1e)
angle_0 = unit.get(unit.ANGLE, unit.PORTB)
SizeList = None
categorylabel0 = None
SizeNumber = None
JeansandDenim = None
categorylabel1 = None
ModeList = None
CasualPants = None
categorylabel2 = None
ModeNumber = None
TopsCategory = None
Selectionnumber = None
SkirtsandSkorts = None
categorylabel3 = None
ColorList = None
BottomsCategory = None
Shorts = None
categorylabel4 = None
ColorNumber = None
Shirts_Collared_Buttoned_ = None
FormalandWorkwear = None
categorylabel5 = None
RedColor = None
T_ShirtsandCasualTops = None
SpecialtyPantsandJumpsuits = None
categorylabel6 = None
GreenColor = None
SleevelessTops = None
AthleisureandLeggings = None
categorylabel7 = None
BlueColor = None
CropTopsandTrendyStyles = None
OtherSpecialtyBottoms = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
rectangle9 = M5Rect(72, 24, 160, 60, 0xFFFFFF, 0xFFFFFF)
label8 = M5TextBox(149, 88, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
rectangle1 = M5Rect(10, 8, 140, 50, 0x000000, 0x000000)
rectangle3 = M5Rect(10, 66, 140, 50, 0x000000, 0x000000)
rectangle4 = M5Rect(170, 66, 140, 50, 0x000000, 0x000000)
rectangle5 = M5Rect(10, 124, 140, 50, 0x000000, 0x000000)
rectangle6 = M5Rect(170, 124, 140, 50, 0x000000, 0x000000)
rectangle7 = M5Rect(10, 182, 140, 50, 0x000000, 0x000000)
rectangle8 = M5Rect(170, 182, 140, 50, 0x000000, 0x000000)
label0 = M5TextBox(10, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label2 = M5TextBox(10, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label3 = M5TextBox(170, 83, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label4 = M5TextBox(10, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label5 = M5TextBox(170, 141, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label6 = M5TextBox(10, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
rectangle2 = M5Rect(170, 8, 140, 50, 0x000000, 0x000000)
label7 = M5TextBox(170, 199, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
label1 = M5TextBox(170, 25, "label0", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
import math
# Describe this function...
def Gameloop():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Scan_item_Mode()
label8.setText('Hello M5')
if btnA.isPressed():
label8.hide()
Choose_Category()
label8.show()
# Describe this function...
def LabelNameBottom():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = 'Jeans and Denim'
categorylabel1 = 'Casual Pants'
categorylabel2 = 'Skirts and Skorts'
categorylabel3 = 'Shorts'
categorylabel4 = 'Formal and Workwear'
categorylabel5 = 'Specialty Pants and Jumpsuits'
categorylabel6 = 'Athleisure and Leggings'
categorylabel7 = 'Other Specialty Bottoms'
# Describe this function...
def Wait_until_A_is_Realeased():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnA.isPressed():
pass
# Describe this function...
def Wait_until_B_is_Realeased():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnB.isPressed():
pass
# Describe this function...
def Wait_until_C_is_Realeased():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
while btnC.isPressed():
pass
# Describe this function...
def Scan_item_Mode():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
pass
# Describe this function...
def Startup():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Hall()
HallLabel()
TopsCategory = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear']
BottomsCategory = ['Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def LabelNameTop():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
categorylabel0 = '(Collared & Buttoned)'
categorylabel1 = 'T-Shirts and Casual'
categorylabel2 = 'Sleeveless Tops'
categorylabel3 = 'Crop Tops and Trendy'
categorylabel4 = 'Formal and Dressy Tops'
categorylabel5 = 'Fashionable Shoulder'
categorylabel6 = 'Specialty Tops'
categorylabel7 = 'Polos and Activewear'
# Describe this function...
def Choose_Category():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
Wait_until_A_is_Realeased()
rectangle9.setPosition(0, 3)
Selectionnumber = 1
LabelNameTop()
Sall()
UpdateLabel0_7()
SallLabel()
while not (btnA.isPressed()):
if btnC.isPressed():
if 9 > Selectionnumber:
if Selectionnumber == 1:
categorylabel0 = 'Mandarin Collar Shirt'
categorylabel1 = 'Button up Shirt'
categorylabel2 = 'Oxford Shirt (formal)'
categorylabel3 = 'Dress Shirt (formal)'
categorylabel4 = 'Cuban Collar Shirt'
categorylabel5 = 'Linen Shirt'
categorylabel6 = 'Flannel Shirt'
categorylabel7 = 'Denim Shirt'
elif Selectionnumber == 2:
categorylabel0 = 'T-Shirt'
categorylabel1 = 'Pocket Tee'
categorylabel2 = 'V-Neck Shirt'
categorylabel3 = 'Crew Neck Shirt'
categorylabel4 = 'Round-Neck Shirt'
categorylabel5 = 'Raglan'
categorylabel6 = 'Henley Shirt'
categorylabel7 = 0
elif Selectionnumber == 3:
categorylabel0 = 'Tank Top'
categorylabel1 = 'Singlet'
categorylabel2 = 'Camisole'
categorylabel3 = 0
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 4:
categorylabel0 = 'Crop top'
categorylabel1 = 'Peplum top'
categorylabel2 = 'Boxy Top'
categorylabel3 = 'Bralette Top'
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 5:
categorylabel0 = 'Wrap Top'
categorylabel1 = 'Bustier Top'
categorylabel2 = 'Blouson Top'
categorylabel3 = 'Blouse'
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 6:
categorylabel0 = 'Off Shoulder Top'
categorylabel1 = 'One Shoulder Top'
categorylabel2 = 'Cold Shoulder Top'
categorylabel3 = 0
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 7:
categorylabel0 = 'Chocker Top'
categorylabel1 = 'Cape Top/Batwing Top'
categorylabel2 = 'Kaftan'
categorylabel3 = 'Tube Top'
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 8:
categorylabel0 = 'Polo Shirt'
categorylabel1 = 'Sleeveless Shirt'
categorylabel2 = 'Long Sleeve Shirt'
categorylabel3 = 'Short Sleeve Shirt'
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
else:
if Selectionnumber == 9:
categorylabel0 = 'Bell Bottoms'
categorylabel1 = 'Flare Jeans/Pants'
categorylabel2 = 'Jeans/Skinny Jeans'
categorylabel3 = 'Jeggings'
categorylabel4 = 'Jorts/(Jean Shorts)'
categorylabel5 = 'Low-rise Jeans'
categorylabel6 = 'Ripped Jeans'
categorylabel7 = 'Straight-leg Jeans/Pants'
elif Selectionnumber == 10:
categorylabel0 = 'Cargo Pants/Utility Pants'
categorylabel1 = 'Chinos'
categorylabel2 = 'Drawstring Pants'
categorylabel3 = 'Joggers'
categorylabel4 = 'Linen Pants/Shorts'
categorylabel5 = 'Lounge Pants'
categorylabel6 = 'Sweatpants'
categorylabel7 = 'Tapered Leggings/Pants'
elif Selectionnumber == 11:
categorylabel0 = 'Denim Skirt'
categorylabel1 = 'Flared Skirt'
categorylabel2 = 'Maxi Skirt'
categorylabel3 = 'Midi Shorts/Skirt'
categorylabel4 = 'Miniskirt'
categorylabel5 = 'Pencil Skirt'
categorylabel6 = 'Pleated Pants/Skirt'
categorylabel7 = 'Side-slit Skirt'
elif Selectionnumber == 12:
categorylabel0 = 'Capri pants'
categorylabel1 = 'Cycling shorts'
categorylabel2 = 'Hot Pants'
categorylabel3 = 'Knee-length Shorts'
categorylabel4 = 'Quilted Shorts'
categorylabel5 = 'Shorts'
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 13:
categorylabel0 = 'Dress Pants'
categorylabel1 = 'Slacks'
categorylabel2 = 'Slim-fit Pants'
categorylabel3 = 'Trousers'
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 14:
categorylabel0 = 'Drop-crotch Pants'
categorylabel1 = 'Dungarees/Overalls'
categorylabel2 = 'Gartered Pants'
categorylabel3 = 'Gaucho Jumpsuit/Pants'
categorylabel4 = 'Harem Pants'
categorylabel5 = 'Parachute pants'
categorylabel6 = 'Palazzo pants'
categorylabel7 = 'Romper'
elif Selectionnumber == 15:
categorylabel0 = 'Leather Pants/Leggings'
categorylabel1 = 'Leggings'
categorylabel2 = 'Yoga Pants/Shorts'
categorylabel3 = 0
categorylabel4 = 0
categorylabel5 = 0
categorylabel6 = 0
categorylabel7 = 0
elif Selectionnumber == 16:
categorylabel0 = 'Motorcycle Pants'
categorylabel1 = 'Sequin Pants'
categorylabel2 = 'Silk Pants'
categorylabel3 = 'Velour Pants'
categorylabel4 = 'Slit-front Pants'
categorylabel5 = 'Zipper Pants'
categorylabel6 = 'High-waisted Pants/Shorts'
categorylabel7 = 0
if math.ceil(((angle_0.read()) / 1024) * 16 + 0) != Selectionnumber:
Selectionnumber = math.ceil(((angle_0.read()) / 1024) * 16 + 0)
if 9 > Selectionnumber:
if Selectionnumber == 1:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 2:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 3:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 4:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 5:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 6:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 7:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 8:
rectangle9.setPosition(160, 180)
LabelNameTop()
Sall()
UpdateLabel0_7()
SallLabel()
else:
if Selectionnumber == 9:
rectangle9.setPosition(0, 3)
elif Selectionnumber == 10:
rectangle9.setPosition(160, 3)
elif Selectionnumber == 11:
rectangle9.setPosition(0, 63)
elif Selectionnumber == 12:
rectangle9.setPosition(160, 63)
elif Selectionnumber == 13:
rectangle9.setPosition(0, 120)
elif Selectionnumber == 14:
rectangle9.setPosition(160, 120)
elif Selectionnumber == 15:
rectangle9.setPosition(0, 180)
elif Selectionnumber == 16:
rectangle9.setPosition(160, 180)
LabelNameBottom()
Sall()
UpdateLabel0_7()
SallLabel()
Hall()
HallLabel()
Wait_until_A_is_Realeased()
# Describe this function...
def HallS9():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def HallLabel():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.hide()
label1.hide()
label2.hide()
label3.hide()
label4.hide()
label5.hide()
label6.hide()
label7.hide()
# Describe this function...
def Hall():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.hide()
rectangle2.hide()
rectangle1.hide()
rectangle3.hide()
rectangle4.hide()
rectangle5.hide()
rectangle6.hide()
rectangle7.hide()
rectangle8.hide()
# Describe this function...
def SallLabel():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.show()
label1.show()
label2.show()
label3.show()
label4.show()
label5.show()
label6.show()
label7.show()
# Describe this function...
def UpdateLabel0_7():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
label0.setText(str(categorylabel0))
label1.setText(str(categorylabel1))
label2.setText(str(categorylabel2))
label3.setText(str(categorylabel3))
label4.setText(str(categorylabel4))
label5.setText(str(categorylabel5))
label6.setText(str(categorylabel6))
label7.setText(str(categorylabel7))
# Describe this function...
def Sall():
global SizeList, categorylabel0, SizeNumber, JeansandDenim, categorylabel1, ModeList, CasualPants, categorylabel2, ModeNumber, TopsCategory, Selectionnumber, SkirtsandSkorts, categorylabel3, ColorList, BottomsCategory, Shorts, categorylabel4, ColorNumber, Shirts_Collared_Buttoned_, FormalandWorkwear, categorylabel5, RedColor, T_ShirtsandCasualTops, SpecialtyPantsandJumpsuits, categorylabel6, GreenColor, SleevelessTops, AthleisureandLeggings, categorylabel7, BlueColor, CropTopsandTrendyStyles, OtherSpecialtyBottoms, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear
rectangle9.show()
rectangle2.show()
rectangle1.show()
rectangle3.show()
rectangle4.show()
rectangle5.show()
rectangle6.show()
rectangle7.show()
rectangle8.show()
Startup()
while True:
Gameloop()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
InactiveTime = None
label0 = M5TextBox(80, 86, "Text", lcd.FONT_DejaVu72, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Check_Inactivity():
global InactiveTime
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
label0.setText('Hello M5')
InactiveTime = 0
else:
InactiveTime = 0
InactiveTime = 0
while True:
label0.setText(str(InactiveTime))
Check_Inactivity()
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
mac = None
clothing = None
colour = None
size = None
new_old = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label0 = M5TextBox(12, 89, "Clothing:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label1 = M5TextBox(12, 126, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(12, 161, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label3 = M5TextBox(12, 200, "Second Life:", lcd.FONT_DejaVu24, 0x176d05, rotate=0)
label4 = M5TextBox(208, 89, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label5 = M5TextBox(208, 126, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(208, 161, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label7 = M5TextBox(208, 200, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
def recv_cb(_):
global mac,clothing,colour,size,new_old
mac, _, clothing = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
label9.setText(str(espnow.get_mac_addr()))
while True:
if clothing == 'Ace':
colour = 'White'
size = 'M'
new_old = 'Yes'
label4.setText(str(clothing))
label5.setText(str(colour))
label6.setText(str(size))
label7.setText(str(new_old))
rgb.setColorAll(0xff0000)
speaker.tone(1800, 200)
elif clothing == 'Bce':
colour = 'Black'
size = 'L'
new_old = 'No'
label4.setText(str(clothing))
label5.setText(str(colour))
label6.setText(str(size))
label7.setText(str(new_old))
rgb.setColorAll(0xff0000)
speaker.tone(1800, 200)
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
colour = None
mac = None
Data = None
size = None
new_old = None
clothing = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label0 = M5TextBox(12, 89, "Clothing:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label1 = M5TextBox(12, 126, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(12, 161, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label3 = M5TextBox(12, 200, "Second Life:", lcd.FONT_DejaVu24, 0x176d05, rotate=0)
label4 = M5TextBox(208, 89, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label5 = M5TextBox(208, 126, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(208, 161, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label7 = M5TextBox(208, 200, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
def recv_cb(_):
global colour,mac,Data,size,new_old,clothing
mac, _, Data = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
label9.setText(str(espnow.get_mac_addr()))
while True:
if len(Data) == 4:
pass
elif len(Data) == 5:
pass
else:
pass
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
mac = None
Data = None
ECOShirts_Collared_Buttoned_ = None
ECOT_ShirtsandCasualTops = None
ECOSleevelessTops = None
ECOCropTopsandTrendyStyles = None
Number2 = None
ECOFormalandDressyTops = None
ECOFashionableShoulderStyles = None
ECOSpecialtyTops = None
ECOPolosandActivewear = None
ECOJeansandDenim = None
CategoryNumber = None
ECOCasualPants = None
ItemNumber = None
ECOSkirtsandSkorts = None
ColorNumber = None
ECOshorts = None
SizeNumber = None
ECOFormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label0 = M5TextBox(12, 89, "Clothing:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label1 = M5TextBox(12, 126, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(12, 161, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label3 = M5TextBox(12, 200, "Second Life:", lcd.FONT_DejaVu24, 0x176d05, rotate=0)
label4 = M5TextBox(208, 89, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label5 = M5TextBox(208, 126, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(208, 161, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label7 = M5TextBox(208, 200, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
# Describe this function...
def ECOLIST():
global mac, Data, ECOShirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, ECOSleevelessTops, ECOCropTopsandTrendyStyles, Number2, ECOFormalandDressyTops, ECOFashionableShoulderStyles, ECOSpecialtyTops, ECOPolosandActivewear, ECOJeansandDenim, CategoryNumber, ECOCasualPants, ItemNumber, ECOSkirtsandSkorts, ColorNumber, ECOshorts, SizeNumber, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, ECOOtherSpecialtyBottoms
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
def recv_cb(_):
global mac,Data,ECOShirts_Collared_Buttoned_,ECOT_ShirtsandCasualTops,ECOSleevelessTops,ECOCropTopsandTrendyStyles,Number2,ECOFormalandDressyTops,ECOFashionableShoulderStyles,ECOSpecialtyTops,ECOPolosandActivewear,ECOJeansandDenim,CategoryNumber,ECOCasualPants,ItemNumber,ECOSkirtsandSkorts,ColorNumber,ECOshorts,SizeNumber,ECOFormalandWorkwear,ECOSpecialtyPantsandJumpsuits,ECOAthleisureandLeggings,ECOOtherSpecialtyBottoms
mac, _, Data = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
ECOLIST()
label9.setText(str(espnow.get_mac_addr()))
Data = 1411
Number2 = str(Data)
while True:
Number2 = str(Data)
if Data != 0:
if len(Number2) == 4:
CategoryNumber = int(Number2[0])
ItemNumber = int(Number2[1])
ColorNumber = int(Number2[2])
SizeNumber = int(Number2[3])
elif len(Number2) == 5:
CategoryNumber = int(Number2[1]) + 10
ItemNumber = int(Number2[2])
ColorNumber = int(Number2[3])
SizeNumber = int(Number2[4])
label4.setFont(lcd.FONT_DefaultSmall)
label4.setPosition(130, 100)
if CategoryNumber == 1:
label4.setText(str(ECOShirts_Collared_Buttoned_[int(ItemNumber - 1)]))
if ColorNumber == 1:
label5.setText('Red')
elif ColorNumber == 2:
label5.setText('Blue')
elif ColorNumber == 3:
label5.setText('Grey')
elif ColorNumber == 4:
label5.setText('White')
elif ColorNumber == 5:
label5.setText('Black')
if SizeNumber == 1:
label6.setText('Xs')
elif SizeNumber == 2:
label6.setText('S')
elif SizeNumber == 3:
label6.setText('M')
elif SizeNumber == 4:
label6.setText('L')
elif SizeNumber == 5:
label6.setText('Xl')
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
mac = None
Data = None
ECOShirts_Collared_Buttoned_ = None
ECOT_ShirtsandCasualTops = None
ECOSleevelessTops = None
ECOCropTopsandTrendyStyles = None
Number2 = None
ECOFormalandDressyTops = None
ECOFashionableShoulderStyles = None
ECOSpecialtyTops = None
ECOPolosandActivewear = None
ECOJeansandDenim = None
CategoryNumber = None
ECOCasualPants = None
ItemNumber = None
ECOSkirtsandSkorts = None
ColorNumber = None
ECOshorts = None
SizeNumber = None
ECOFormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label1 = M5TextBox(12, 126, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(12, 161, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label3 = M5TextBox(12, 200, "Second Life:", lcd.FONT_DejaVu24, 0x176d05, rotate=0)
label4 = M5TextBox(12, 45, "Text", lcd.FONT_DejaVu24, 0xff0000, rotate=0)
label5 = M5TextBox(208, 126, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(208, 161, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label7 = M5TextBox(208, 200, "Text", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
# Describe this function...
def ECOLIST():
global mac, Data, ECOShirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, ECOSleevelessTops, ECOCropTopsandTrendyStyles, Number2, ECOFormalandDressyTops, ECOFashionableShoulderStyles, ECOSpecialtyTops, ECOPolosandActivewear, ECOJeansandDenim, CategoryNumber, ECOCasualPants, ItemNumber, ECOSkirtsandSkorts, ColorNumber, ECOshorts, SizeNumber, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, ECOOtherSpecialtyBottoms
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
def recv_cb(_):
global mac,Data,ECOShirts_Collared_Buttoned_,ECOT_ShirtsandCasualTops,ECOSleevelessTops,ECOCropTopsandTrendyStyles,Number2,ECOFormalandDressyTops,ECOFashionableShoulderStyles,ECOSpecialtyTops,ECOPolosandActivewear,ECOJeansandDenim,CategoryNumber,ECOCasualPants,ItemNumber,ECOSkirtsandSkorts,ColorNumber,ECOshorts,SizeNumber,ECOFormalandWorkwear,ECOSpecialtyPantsandJumpsuits,ECOAthleisureandLeggings,ECOOtherSpecialtyBottoms
mac, _, Data = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
ECOLIST()
label9.setText(str(espnow.get_mac_addr()))
Data = 0
Number2 = str(Data)
while True:
Number2 = str(Data)
if Data != 0:
if len(Number2) == 4:
CategoryNumber = int(Number2[0])
ItemNumber = int(Number2[1])
ColorNumber = int(Number2[2])
SizeNumber = int(Number2[3])
elif len(Number2) == 5:
CategoryNumber = int(Number2[1]) + 10
ItemNumber = int(Number2[2])
ColorNumber = int(Number2[3])
SizeNumber = int(Number2[4])
label4.setFont(lcd.FONT_DefaultSmall)
label4.setPosition(130, 100)
if CategoryNumber == 1:
label4.setText(str(ECOShirts_Collared_Buttoned_[int(ItemNumber - 1)]))
if ColorNumber == 1:
label5.setText('Red')
elif ColorNumber == 2:
label5.setText('Blue')
elif ColorNumber == 3:
label5.setText('Grey')
elif ColorNumber == 4:
label5.setText('White')
elif ColorNumber == 5:
label5.setText('Black')
if SizeNumber == 1:
label6.setText('Xs')
elif SizeNumber == 2:
label6.setText('S')
elif SizeNumber == 3:
label6.setText('M')
elif SizeNumber == 4:
label6.setText('L')
elif SizeNumber == 5:
label6.setText('Xl')
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
mac = None
Data = None
ECOShirts_Collared_Buttoned_ = None
ECOT_ShirtsandCasualTops = None
ECOSleevelessTops = None
ECOCropTopsandTrendyStyles = None
Number2 = None
ECOFormalandDressyTops = None
ECOFashionableShoulderStyles = None
ECOSpecialtyTops = None
ECOPolosandActivewear = None
ECOJeansandDenim = None
CategoryNumber = None
ECOCasualPants = None
ItemNumber = None
ECOSkirtsandSkorts = None
ColorNumber = None
ECOshorts = None
SizeNumber = None
ECOFormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label1 = M5TextBox(27, 154, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(27, 195, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label4 = M5TextBox(27, 83, "Awaiting Orders", lcd.FONT_DejaVu24, 0xff0000, rotate=0)
label5 = M5TextBox(176, 154, "waiting", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(176, 195, "waiting", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
# Describe this function...
def ECOLIST():
global mac, Data, ECOShirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, ECOSleevelessTops, ECOCropTopsandTrendyStyles, Number2, ECOFormalandDressyTops, ECOFashionableShoulderStyles, ECOSpecialtyTops, ECOPolosandActivewear, ECOJeansandDenim, CategoryNumber, ECOCasualPants, ItemNumber, ECOSkirtsandSkorts, ColorNumber, ECOshorts, SizeNumber, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, ECOOtherSpecialtyBottoms
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
def recv_cb(_):
global mac,Data,ECOShirts_Collared_Buttoned_,ECOT_ShirtsandCasualTops,ECOSleevelessTops,ECOCropTopsandTrendyStyles,Number2,ECOFormalandDressyTops,ECOFashionableShoulderStyles,ECOSpecialtyTops,ECOPolosandActivewear,ECOJeansandDenim,CategoryNumber,ECOCasualPants,ItemNumber,ECOSkirtsandSkorts,ColorNumber,ECOshorts,SizeNumber,ECOFormalandWorkwear,ECOSpecialtyPantsandJumpsuits,ECOAthleisureandLeggings,ECOOtherSpecialtyBottoms
mac, _, Data = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
ECOLIST()
label9.setText(str(espnow.get_mac_addr()))
Data = 0
Number2 = str(Data)
while True:
Number2 = str(Data)
if Data != 0:
if len(Number2) == 4:
CategoryNumber = int(Number2[0])
ItemNumber = int(Number2[1])
ColorNumber = int(Number2[2])
SizeNumber = int(Number2[3])
elif len(Number2) == 5:
CategoryNumber = int(Number2[1]) + 10
ItemNumber = int(Number2[2])
ColorNumber = int(Number2[3])
SizeNumber = int(Number2[4])
label4.setFont(lcd.FONT_DejaVu18)
label4.setPosition(30, 70)
if CategoryNumber == 1:
label4.setText(str(ECOShirts_Collared_Buttoned_[int(ItemNumber - 1)]))
if ColorNumber == 1:
label5.setText('Red')
elif ColorNumber == 2:
label5.setText('Blue')
elif ColorNumber == 3:
label5.setText('Grey')
elif ColorNumber == 4:
label5.setText('White')
elif ColorNumber == 5:
label5.setText('Black')
if SizeNumber == 1:
label6.setText('Xs')
elif SizeNumber == 2:
label6.setText('S')
elif SizeNumber == 3:
label6.setText('M')
elif SizeNumber == 4:
label6.setText('L')
elif SizeNumber == 5:
label6.setText('Xl')
while not (btnC.isPressed()):
speaker.tone(1800, 200)
rgb.setColorAll(0xff0000)
Data = 0
rgb.setBrightness(0)
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
InactiveTime = None
RFIDreaded = None
Tb1 = M5TextBox(25, 28, "Scan an item or choose a category to get started", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(25, 60, "Scan an item or choose a category to get started", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(25, 90, "Scan an item or choose a category to get started", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(190, 3, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(217, 3, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(54, 224, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(143, 224, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(182, 224, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Check_Inactivity():
global InactiveTime, RFIDreaded
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
pass
InactiveTime = 0
else:
InactiveTime = 0
InactiveTime = 0
RFIDreaded = 0
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(190, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
BtnA.hide()
BtnB.hide()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
pass
elif rfid_0.isCardOn():
pass
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
InactiveTime = None
RFIDreaded = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(170, 3, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(217, 3, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(54, 224, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(143, 224, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(182, 224, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(3, 3, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(90, 3, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
from numbers import Number
# Describe this function...
def Check_Inactivity():
global InactiveTime, RFIDreaded
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 5 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def SelectCategory():
global InactiveTime, RFIDreaded
pass
InactiveTime = 0
RFIDreaded = 0
while True:
Check_Inactivity()
InactiveTimerNumber.setText(str(InactiveTime))
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
SelectCategory()
elif rfid_0.isCardOn():
pass
Tb1.show()
Tb2.show()
Tb3.show()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
InactiveTime = None
RFIDreaded = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(100, 100, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(100, 100, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(100, 100, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(100, 100, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(100, 100, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(100, 100, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(100, 100, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Wcir = M5Circle(166, 174, 15, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
# Describe this function...
def Check_Inactivity():
global InactiveTime, RFIDreaded
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 90 <= InactiveTime:
while not (btnA.wasPressed()):
Wcir.hide()
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global InactiveTime, RFIDreaded
pass
# Describe this function...
def Select_Category():
global InactiveTime, RFIDreaded
while not (btnA.wasPressed()):
Wcir.show()
Wcir.setSize(500)
Wcir.setPosition(160, 660)
Tb1.show()
Tb2.show()
Tb3.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
InactiveTime = 0
RFIDreaded = 0
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Wcir.hide()
Tb1.show()
Tb2.show()
Tb3.show()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
Categorys = None
InactiveTime = None
Shirts_Collared_Buttoned_ = None
RFIDreaded = None
T_ShirtsandCasualTops = None
SleevelessTops = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
Angle = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Startup():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, Angle
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Check_Inactivity():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, Angle
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 90 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, Angle
pass
# Describe this function...
def Select_Category():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, Angle
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == len(Categorys) - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == len(Categorys) - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
pass
InactiveTime = 0
RFIDreaded = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
Categorys = None
InactiveTime = None
Shirts_Collared_Buttoned_ = None
RFIDreaded = None
T_ShirtsandCasualTops = None
SleevelessTops = None
MAXLength = None
CropTopsandTrendyStyles = None
Angle = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Startup():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, MAXLength, CropTopsandTrendyStyles, Angle, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Check_Inactivity():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, MAXLength, CropTopsandTrendyStyles, Angle, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 90 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, MAXLength, CropTopsandTrendyStyles, Angle, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
pass
# Describe this function...
def Select_Category():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, MAXLength, CropTopsandTrendyStyles, Angle, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, MAXLength, CropTopsandTrendyStyles, Angle, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 1:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 2:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 3:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 4:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 5:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 6:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 7:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 8:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 9:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 10:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 11:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 12:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 13:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 14:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 15:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
while btnB.isPressed():
pass
InactiveTime = 0
RFIDreaded = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
Categorys = None
InactiveTime = None
Shirts_Collared_Buttoned_ = None
RFIDreaded = None
T_ShirtsandCasualTops = None
SleevelessTops = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
MAXLength = None
Angle = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Startup():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Check_Inactivity():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 5 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle
pass
# Describe this function...
def Select_Category():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 1:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 2:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 3:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 4:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 5:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 6:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 7:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 8:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 9:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 10:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 11:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 12:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 13:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 14:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 15:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
while btnB.isPressed():
pass
InactiveTime = 0
RFIDreaded = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
Categorys = None
InactiveTime = None
Shirts_Collared_Buttoned_ = None
RFIDreaded = None
T_ShirtsandCasualTops = None
SleevelessTops = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
MAXLength = None
Angle = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Startup():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Check_Inactivity():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
pass
# Describe this function...
def Select_Category():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 2:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 3:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 4:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 5:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 6:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 7:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 8:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 9:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 10:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 11:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 12:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 13:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 14:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 15:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global Categorys, InactiveTime, Shirts_Collared_Buttoned_, RFIDreaded, T_ShirtsandCasualTops, SleevelessTops, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText('alternative instead')
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
pass
InactiveTime = 0
RFIDreaded = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOShirts_Collared_Buttoned_ = None
Categorys = None
InactiveTime = None
T_ShirtsandCasualTops = None
Shirts_Collared_Buttoned_ = None
RFIDreaded = None
SleevelessTops = None
CatergoryNumber = None
CropTopsandTrendyStyles = None
FormalandDressyTops = None
FashionableShoulderStyles = None
SpecialtyTops = None
PolosandActivewear = None
JeansandDenim = None
CasualPants = None
SkirtsandSkorts = None
Shorts = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
OtherSpecialtyBottoms = None
MAXLength = None
Angle = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def Startup():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Check_Inactivity():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu24)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 2:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 3:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 4:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 5:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 6:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 7:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 8:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 9:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 10:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 11:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 12:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 13:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 14:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == 15:
while not (btnB.isPressed()):
MAXLength = len(Shirts_Collared_Buttoned_)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOShirts_Collared_Buttoned_, Categorys, InactiveTime, T_ShirtsandCasualTops, Shirts_Collared_Buttoned_, RFIDreaded, SleevelessTops, CatergoryNumber, CropTopsandTrendyStyles, FormalandDressyTops, FashionableShoulderStyles, SpecialtyTops, PolosandActivewear, JeansandDenim, CasualPants, SkirtsandSkorts, Shorts, FormalandWorkwear, SpecialtyPantsandJumpsuits, AthleisureandLeggings, OtherSpecialtyBottoms, MAXLength, Angle, SelectedItem
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText('alternative instead')
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
pass
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
V31_11Feb
PythonWhen the user select Non-Eco item A, code recommends Eco item A
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
InactiveTime = None
Shirts_Collared_Buttoned_ = None
Categorys = None
ECOT_ShirtsandCasualTops = None
RFIDreaded = None
T_ShirtsandCasualTops = None
ECOalt = None
ECOSleevelessTops = None
CatergoryNumber = None
SleevelessTops = None
Angle = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
iTEMnUMBER = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
MAXLength = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb5 = M5TextBox(135, 41, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu24)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
pass
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
Categorys = None
InactiveTime = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
ECOalt = None
ECOSleevelessTops = None
SleevelessTops = None
CatergoryNumber = None
Angle = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
iTEMnUMBER = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
MAXLength = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(46, 31, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(93, 31, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(145, 31, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(187, 31, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(230, 33, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
from numbers import Number
import math
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
while btnC.isPressed():
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
colororsize()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb2.show()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
while not (btnB.isPressed()):
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
pass
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, Categorys, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, MAXLength, SelectedItem
pass
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.show()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
Shirts_Collared_Buttoned_ = None
ECOShirts_Collared_Buttoned_ = None
T_ShirtsandCasualTops = None
InactiveTime = None
MAXLength = None
ECOT_ShirtsandCasualTops = None
ECOalt = None
SleevelessTops = None
RFIDreaded = None
ECOSleevelessTops = None
CatergoryNumber = None
Angle = None
CropTopsandTrendyStyles = None
Categorys = None
ECOCropTopsandTrendyStyles = None
iTEMnUMBER = None
FormalandDressyTops = None
ECOFormalandDressyTops = None
FashionableShoulderStyles = None
ECOFashionableShoulderStyles = None
SpecialtyTops = None
ECOSpecialtyTops = None
PolosandActivewear = None
ECOPolosandActivewear = None
JeansandDenim = None
ECOJeansandDenim = None
CasualPants = None
ECOCasualPants = None
SkirtsandSkorts = None
ECOSkirtsandSkorts = None
Shorts = None
ECOshorts = None
FormalandWorkwear = None
ECOFormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
ECOSpecialtyPantsandJumpsuits = None
AthleisureandLeggings = None
ECOAthleisureandLeggings = None
OtherSpecialtyBottoms = None
ECOOtherSpecialtyBottoms = None
Color = None
Size = None
SelectedItem = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
import math
from numbers import Number
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
espnow.add_peer('f0:08:d1:c7:3e:1d', id=1)
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
colororsize()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb2.show()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
while not (btnB.isPressed()):
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
while not (btnB.isPressed()):
Tb1.show()
Tb2.hide()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb1.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
if btnC.isPressed():
Color = 0
Tb2.setText(str(Color))
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, InactiveTime, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, RFIDreaded, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, ECOFashionableShoulderStyles, FashionableShoulderStyles, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
pass
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
Tb1.hide()
Tb2.hide()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.show()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
ECOSleevelessTops = None
SleevelessTops = None
CatergoryNumber = None
Angle = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
iTEMnUMBER = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
Color = None
Size = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
import math
from numbers import Number
# Describe this function...
def Select_Category():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def NONECOLIST():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
pass
# Describe this function...
def ECOLIST():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def Select_item():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
colororsize()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
while not (btnB.isPressed()):
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
triangle0.hide()
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while not (btnB.isPressed()):
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
# Describe this function...
def size():
global ECOshort, Shirts_Collared_Buttoned_, InactiveTime, ECOShirts_Collared_Buttoned_, MAXLength, T_ShirtsandCasualTops, RFIDreaded, ECOT_ShirtsandCasualTops, ECOalt, SleevelessTops, CatergoryNumber, ECOSleevelessTops, Angle, Categorys, CropTopsandTrendyStyles, ECOCropTopsandTrendyStyles, iTEMnUMBER, FormalandDressyTops, Sizelist, ECOFormalandDressyTops, FashionableShoulderStyles, ColorList, ECOFashionableShoulderStyles, SpecialtyTops, ECOSpecialtyTops, PolosandActivewear, ECOPolosandActivewear, JeansandDenim, ECOJeansandDenim, CasualPants, ECOCasualPants, SkirtsandSkorts, ECOSkirtsandSkorts, Shorts, ECOshorts, FormalandWorkwear, ECOFormalandWorkwear, SpecialtyPantsandJumpsuits, ECOSpecialtyPantsandJumpsuits, AthleisureandLeggings, ECOAthleisureandLeggings, OtherSpecialtyBottoms, ECOOtherSpecialtyBottoms, Color, Size, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while not (btnB.isPressed()):
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
ECOSleevelessTops = None
SleevelessTops = None
CatergoryNumber = None
Angle = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
iTEMnUMBER = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
Color = None
Size = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
colororsize()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
while not (btnB.isPressed()):
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
triangle0.hide()
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while not (btnB.isPressed()):
Tb6.setText('Choose your size')
while btnC.isPressed():
pass
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, ECOSleevelessTops, SleevelessTops, CatergoryNumber, Angle, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, iTEMnUMBER, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Color, Size, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your size')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.setText('Choose your color')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
Tb1.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
CatergoryNumber = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
iTEMnUMBER = None
ECOSleevelessTops = None
SleevelessTops = None
Angle = None
Color = None
Size = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Btn.A to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while not (btnB.isPressed()):
if btnC.isPressed():
colororsize()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select item')
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your size')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.setText('Choose your color')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnB.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
Tb3.hide()
Tb4.hide()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
while not (btnB.isPressed()):
if btnA.isPressed():
kolor()
while btnB.isPressed():
pass
elif btnC.isPressed():
size()
while btnB.isPressed():
pass
triangle0.hide()
Tb6.hide()
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while not (btnB.isPressed()):
Tb6.setText('Choose your size')
while btnC.isPressed():
pass
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
CatergoryNumber = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
iTEMnUMBER = None
ECOSleevelessTops = None
SleevelessTops = None
Angle = None
Color = None
Size = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
SelectedItem = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Left Button to Exit')
InactiveTime = 0
else:
InactiveTime = 0
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
pass
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
BtnB.setText('Back')
BtnC.setText('Select item')
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb5.setFont(lcd.FONT_DefaultSmall)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]
Selected_item()
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
if btnC.isPressed():
colororsize()
while btnB.isPressed():
pass
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your size')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
BtnB.setText('Back')
BtnC.setText('Comfirm')
Tb6.setText('Choose your color')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.setText('Choose your size')
BtnB.setText('Back')
BtnC.setText('Comfirm')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, SelectedItem
while not (btnB.isPressed()):
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
triangle0.hide()
Tb6.hide()
while btnB.isPressed():
pass
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label0 = M5TextBox(80, 100, "Sending...", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label1 = M5TextBox(87, 142, "_", lcd.FONT_Default, 0xFFFFFF, rotate=0)
espnow.add_peer('f0:08:d1:c7:3e:1d', id=1)
while True:
if btnA.isPressed():
espnow.send(id=1, data=str('9134'))
label1.setText('9134')
elif btnB.isPressed():
espnow.send(id=1, data=str('14512'))
label1.setText('14512')
elif btnC.isPressed():
espnow.send(id=1, data=str('13435'))
label1.setText('13435')
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOshort = None
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
CatergoryNumber = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
iTEMnUMBER = None
ECOSleevelessTops = None
SleevelessTops = None
Angle = None
Color = None
Size = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
SelectedItem = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
JeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
FormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
SpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def RFIDItem():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
if (rfid_0.readUid()) == '':
CatergoryNumber = 1
iTEMnUMBER = 1
SelectedItem = Shirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
Selected_item()
# Describe this function...
def ECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Left Button to Exit')
InactiveTime = 0
while btnA.isPressed():
pass
else:
InactiveTime = 0
# Describe this function...
def Select_Category():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
BtnB.setText('Back')
BtnC.setText('Select item')
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb5.setFont(lcd.FONT_DefaultSmall)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
Selected_item()
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
elif Angle == 16:
pass
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
if btnC.isPressed():
colororsize()
while btnB.isPressed():
pass
# Describe this function...
def size():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your size')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
BtnB.setText('Back')
BtnC.setText('Comfirm')
Tb6.setText('Choose your color')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.setText('Choose your size')
BtnB.setText('Back')
BtnC.setText('Comfirm')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOshort, ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Angle, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, JeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, FormalandWorkwear, ECOSpecialtyPantsandJumpsuits, SpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms
while not (btnB.isPressed()):
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
triangle0.hide()
Tb6.hide()
while btnB.isPressed():
pass
Startup()
while True:
Check_Inactivity()
if rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
else:
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import espnow
import wifiCfg
setScreenColor(0x222222)
mac = None
Data = None
ECOShirts_Collared_Buttoned_ = None
ECOT_ShirtsandCasualTops = None
ECOSleevelessTops = None
ECOCropTopsandTrendyStyles = None
Number2 = None
ECOFormalandDressyTops = None
ECOFashionableShoulderStyles = None
ECOSpecialtyTops = None
ECOPolosandActivewear = None
ECOJeansandDenim = None
CategoryNumber = None
ECOCasualPants = None
ItemNumber = None
ECOSkirtsandSkorts = None
ColorNumber = None
ECOshorts = None
SizeNumber = None
ECOFormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
wifiCfg.wlan_ap.active(True)
wifiCfg.wlan_sta.active(True)
espnow.init()
label1 = M5TextBox(27, 154, "Colour:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label2 = M5TextBox(27, 195, "Size:", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label4 = M5TextBox(27, 83, "Awaiting Orders", lcd.FONT_DejaVu24, 0xff0000, rotate=0)
label5 = M5TextBox(176, 154, "waiting", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label6 = M5TextBox(176, 195, "waiting", lcd.FONT_DejaVu24, 0xFFFFFF, rotate=0)
label8 = M5TextBox(12, 11, "Mac:", lcd.FONT_Default, 0xFFFFFF, rotate=0)
label9 = M5TextBox(59, 11, "Text", lcd.FONT_Default, 0xFFFFFF, rotate=0)
# Describe this function...
def ECOLIST():
global mac, Data, ECOShirts_Collared_Buttoned_, ECOT_ShirtsandCasualTops, ECOSleevelessTops, ECOCropTopsandTrendyStyles, Number2, ECOFormalandDressyTops, ECOFashionableShoulderStyles, ECOSpecialtyTops, ECOPolosandActivewear, ECOJeansandDenim, CategoryNumber, ECOCasualPants, ItemNumber, ECOSkirtsandSkorts, ColorNumber, ECOshorts, SizeNumber, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, ECOOtherSpecialtyBottoms
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
def recv_cb(_):
global mac,Data,ECOShirts_Collared_Buttoned_,ECOT_ShirtsandCasualTops,ECOSleevelessTops,ECOCropTopsandTrendyStyles,Number2,ECOFormalandDressyTops,ECOFashionableShoulderStyles,ECOSpecialtyTops,ECOPolosandActivewear,ECOJeansandDenim,CategoryNumber,ECOCasualPants,ItemNumber,ECOSkirtsandSkorts,ColorNumber,ECOshorts,SizeNumber,ECOFormalandWorkwear,ECOSpecialtyPantsandJumpsuits,ECOAthleisureandLeggings,ECOOtherSpecialtyBottoms
mac, _, Data = espnow.recv_data(encoder='str')
pass
espnow.recv_cb(recv_cb)
ECOLIST()
label9.setText(str(espnow.get_mac_addr()))
Data = 0
Number2 = str(Data)
while True:
Number2 = str(Data)
if Data != 0:
if len(Number2) == 4:
CategoryNumber = int(Number2[0])
ItemNumber = int(Number2[1])
ColorNumber = int(Number2[2])
SizeNumber = int(Number2[3])
elif len(Number2) == 5:
CategoryNumber = int(Number2[1]) + 10
ItemNumber = int(Number2[2])
ColorNumber = int(Number2[3])
SizeNumber = int(Number2[4])
label4.setFont(lcd.FONT_DejaVu18)
label4.setPosition(30, 70)
if CategoryNumber == 1:
label4.setText(str(ECOShirts_Collared_Buttoned_[int(ItemNumber - 1)]))
elif CategoryNumber == 9:
label4.setText(str(ECOJeansandDenim[int(ItemNumber - 1)]))
elif CategoryNumber == 13:
label4.setText(str(ECOFormalandWorkwear[int(ItemNumber - 1)]))
elif CategoryNumber == 14:
label4.setText(str(ECOSpecialtyPantsandJumpsuits[int(ItemNumber - 1)]))
if ColorNumber == 1:
label5.setText('Red')
elif ColorNumber == 2:
label5.setText('Blue')
elif ColorNumber == 3:
label5.setText('Grey')
elif ColorNumber == 4:
label5.setText('White')
elif ColorNumber == 5:
label5.setText('Black')
if SizeNumber == 1:
label6.setText('Xs')
elif SizeNumber == 2:
label6.setText('S')
elif SizeNumber == 3:
label6.setText('M')
elif SizeNumber == 4:
label6.setText('L')
elif SizeNumber == 5:
label6.setText('Xl')
while not (btnC.isPressed()):
speaker.tone(1800, 200)
rgb.setColorAll(0xff0000)
Data = 0
rgb.setBrightness(0)
wait_ms(2)
from m5stack import *
from m5ui import *
from uiflow import *
import unit
setScreenColor(0x222222)
pbhub_1 = unit.get(unit.PBHUB, unit.PAHUB0)
rfid_0 = unit.get(unit.RFID, unit.PAHUB1)
pir_1 = unit.get(unit.PIR, unit.PORTB)
ECOShirts_Collared_Buttoned_ = None
Shirts_Collared_Buttoned_ = None
InactiveTime = None
CatergoryNumber = None
ECOT_ShirtsandCasualTops = None
T_ShirtsandCasualTops = None
RFIDreaded = None
MAXLength = None
ECOalt = None
iTEMnUMBER = None
ECOSleevelessTops = None
SleevelessTops = None
Color = None
Size = None
ECOCropTopsandTrendyStyles = None
CropTopsandTrendyStyles = None
Categorys = None
SelectedItem = None
JeansandDenim = None
FormalandWorkwear = None
SpecialtyPantsandJumpsuits = None
ECOFormalandDressyTops = None
FormalandDressyTops = None
Sizelist = None
ECOFashionableShoulderStyles = None
FashionableShoulderStyles = None
ColorList = None
ECOSpecialtyTops = None
SpecialtyTops = None
ECOPolosandActivewear = None
PolosandActivewear = None
ECOJeansandDenim = None
ECOCasualPants = None
CasualPants = None
ECOSkirtsandSkorts = None
SkirtsandSkorts = None
ECOshorts = None
Shorts = None
ECOFormalandWorkwear = None
ECOSpecialtyPantsandJumpsuits = None
ECOAthleisureandLeggings = None
AthleisureandLeggings = None
ECOOtherSpecialtyBottoms = None
OtherSpecialtyBottoms = None
Angle = None
Tb1 = M5TextBox(100, 100, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb2 = M5TextBox(100, 167, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb3 = M5TextBox(46, 141, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
RFIDID = M5TextBox(73, 110, "RFID:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
RFIDREAD = M5TextBox(125, 83, "RFID", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
BtnA = M5TextBox(135, 83, "BtnA", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnB = M5TextBox(73, 72, "BtnB", lcd.FONT_Default, 0xFFFFFF, rotate=0)
BtnC = M5TextBox(157, 141, "BtnC", lcd.FONT_Default, 0xFFFFFF, rotate=0)
InactiveTimer = M5TextBox(106, 131, "Inactive Time:", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
InactiveTimerNumber = M5TextBox(81, 114, "Inactive Time", lcd.FONT_DefaultSmall, 0xFFFFFF, rotate=0)
SQ1 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ2 = M5Rect(69, 192, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ3 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
SQ4 = M5Rect(70, 190, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb4 = M5TextBox(135, 120, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
SQ5 = M5Rect(53, 167, 30, 30, 0xFFFFFF, 0xFFFFFF)
Tb5 = M5TextBox(135, 40, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
Tb6 = M5TextBox(172, 39, "Scan an item", lcd.FONT_DejaVu18, 0xFFFFFF, rotate=0)
triangle0 = M5Triangle(7, 90, 7, 120, 25, 105, 0xFFFFFF, 0xFFFFFF)
from numbers import Number
import math
# Describe this function...
def RFIDItem():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
if (rfid_0.readUid()) == 'c089244f22':
CatergoryNumber = 9
iTEMnUMBER = 1
SelectedItem = JeansandDenim[int(iTEMnUMBER - 1)]
Selected_item()
elif (rfid_0.readUid()) == 'd0f6154f7c':
CatergoryNumber = 14
iTEMnUMBER = 7
SelectedItem = SpecialtyPantsandJumpsuits[int(iTEMnUMBER - 1)]
Selected_item()
elif (rfid_0.readUid()) == '209294f4f':
CatergoryNumber = 14
iTEMnUMBER = 5
SelectedItem = SpecialtyPantsandJumpsuits[int(iTEMnUMBER - 1)]
Selected_item()
elif (rfid_0.readUid()) == 'e034174f8c':
CatergoryNumber = 13
iTEMnUMBER = 4
SelectedItem = FormalandWorkwear[int(iTEMnUMBER - 1)]
Selected_item()
# Describe this function...
def ECOLIST():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
ECOShirts_Collared_Buttoned_ = ['Hemp Mandarin Collar Shirt', 'Organic Linen Button-Up Shirt', 'Organic Cotton Oxford Shirt', 'Organic Poplin Dress Shirt', 'Tencel Cuban Collar Shirt', 'Sustainable Flax Linen Shirt', 'Recycled Wool Flannel Shirt', 'Upcycled Denim Shirt']
ECOT_ShirtsandCasualTops = ['Organic Cotton T-Shirt', 'Recycled Cotton Pocket Tee', 'Hemp V-Neck Shirt', 'Organic Cotton Crew Neck', 'Bamboo Round-Neck Shirt', 'Tencel Raglan Shirt', 'Bamboo Henley Shirt']
ECOSleevelessTops = ['Bamboo Tank Top', 'Hemp Singlet', 'Silk or Tencel Camisole']
ECOCropTopsandTrendyStyles = ['Recycled Fabric Crop Top', 'Organic Cotton Peplum Top', 'Hemp Boxy Top', 'Bamboo Bralette']
ECOFormalandDressyTops = ['Tencel Wrap Top', 'Recycled Fabric Bustier Top', 'Hemp Blouson Top', 'Tencel Blouse']
ECOFashionableShoulderStyles = ['Hemp Off Shoulder Top', 'Bamboo One Shoulder Top', 'Organic Linen Cold Shoulder Top']
ECOSpecialtyTops = ['Organic Cotton Choker Top', 'Linen Batwing Top', 'Organic Cotton Kaftan', 'Recycled Cotton Tube Top']
ECOPolosandActivewear = ['Organic Cotton Polo Shirt', 'Bamboo Sleeveless Shirt', 'Tencel Long Sleeve Shirt', 'Linen Short Sleeve Shirt']
ECOJeansandDenim = ['Organic Cotton Bell Bottoms', 'Recycled Denim Flare Jeans', 'Upcycled Skinny Jeans', 'Hemp Jeggings', 'Upcycled Denim Shorts', 'Organic Cotton Low-Rise Jeans', 'Recycled Denim Ripped Jeans', 'Organic Cotton Straight-Leg Jeans']
ECOCasualPants = ['Hemp Cargo Pants', 'Organic Cotton Chinos', 'Bamboo Drawstring Pants', 'Recycled Polyester Joggers', 'Sustainable Linen Pants', 'Organic Cotton Lounge Pants', 'Recycled Fabric Sweatpants', 'Hemp Tapered Pants']
ECOSkirtsandSkorts = ['Upcycled Denim Skirt', 'Organic Linen Flared Skirt', 'Bamboo Maxi Skirt', 'Tencel Midi Skirt', 'Hemp Miniskirt', 'Organic Cotton Pencil Skirt', 'Recycled Polyester Pleated Skirt', 'Organic Cotton Side-Slit Skirt']
ECOshorts = ['Organic Cotton Capri Pants', 'Recycled Nylon Cycling Shorts', 'Hemp Hot Pants', 'Organic Linen Knee-Length Shorts', 'Recycled Fabric Quilted Shorts', 'Bamboo Shorts']
ECOFormalandWorkwear = ['Organic Wool Dress Pants', 'Tencel Slacks', 'Hemp Slim-Fit Pants', 'Organic Cotton Trousers']
ECOSpecialtyPantsandJumpsuits = ['Bamboo Drop-Crotch Pants', 'Organic Denim Overalls', 'Tencel Gartered Pants', 'Hemp Gaucho Pants', 'Bamboo Harem Pants', 'Recycled Nylon Parachute Pants', 'Organic Cotton Palazzo Pants', 'Linen Romper']
ECOAthleisureandLeggings = ['Vegan Leather Pants', 'Recycled Nylon Leggings', 'Bamboo Yoga Pants', 'Hemp Velvet Leggings']
ECOOtherSpecialtyBottoms = ['Recycled Polyester Motorcycle Pants', 'Upcycled Sequin Pants', 'Sustainable Mulberry Silk Pants', 'Organic Cotton Velour Pants', 'Hemp Slit-Front Pants', 'Recycled Nylon Zipper Pants', 'Tencel High-Waisted Pants']
# Describe this function...
def NONECOLIST():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
Shirts_Collared_Buttoned_ = ['Mandarin Collar Shirt', 'Button up Shirt', 'Oxford Shirt (formal)', 'Dress Shirt (formal)', 'Cuban Collar Shirt', 'Linen Shirt', 'Flannel Shirt', 'Denim Shirt']
T_ShirtsandCasualTops = ['T-Shirt', 'Pocket Tee', 'V-Neck Shirt', 'Crew Neck Shirt', 'Round-Neck Shirt', 'Raglan', 'Henley Shirt']
SleevelessTops = ['Tank Top', 'Singlet', 'Camisole']
CropTopsandTrendyStyles = ['Crop top', 'Peplum top', 'Boxy Top', 'Bralette Top']
FormalandDressyTops = ['Wrap Top', 'Bustier Top', 'Blouson Top', 'Blouse']
FashionableShoulderStyles = ['Off Shoulder Top', 'One Shoulder Top', 'Cold Shoulder Top']
SpecialtyTops = ['Chocker Top', 'Cape Top/Batwing Top', 'Kaftan', 'Tube Top']
PolosandActivewear = ['Polo Shirt', 'Sleeveless Shirt', 'Long Sleeve Shirt', 'Short Sleeve Shirt']
JeansandDenim = ['Bell Bottoms', 'Flare Jeans/Pants', 'Jeans/Skinny Jeans', 'Jeggings', 'Jorts/(Jean Shorts)', 'Low-rise Jeans', 'Ripped Jeans', 'Straight-leg Jeans/Pants']
CasualPants = ['Cargo Pants/Utility Pants', 'Chinos', 'Drawstring Pants', 'Joggers', 'Linen Pants/Shorts', 'Lounge Pants', 'Sweatpants', 'Tapered Leggings/Pants']
SkirtsandSkorts = ['Denim Skirt', 'Flared Skirt', 'Maxi Skirt', 'Midi Shorts/Skirt', 'Miniskirt', 'Pencil Skirt', 'Pleated Pants/Skirt', 'Side-slit Skirt']
Shorts = ['Capri pants', 'Cycling shorts', 'Hot Pants', 'Knee-length Shorts', 'Quilted Shorts', 'Shorts']
FormalandWorkwear = ['Dress Pants', 'Slacks', 'Slim-fit Pants', 'Trousers']
SpecialtyPantsandJumpsuits = ['Drop-crotch Pants', 'Dungarees/Overalls', 'Gartered Pants', 'Gaucho Jumpsuit/Pants', 'Harem Pants', 'Parachute pants', 'Palazzo pants', 'Romper']
AthleisureandLeggings = ['Leather Pants/Leggings', 'Leggings', 'Yoga Pants/Shorts', 'Velvet Leggings']
OtherSpecialtyBottoms = ['Motorcycle Pants', 'Sequin Pants', 'Silk Pants', 'Velour Pants', 'Slit-front Pants', 'Zipper Pants', 'High-waisted Pants/Shorts']
# Describe this function...
def Startup():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
InactiveTime = 0
RFIDreaded = 0
CatergoryNumber = 0
Categorys = ['Shirts (Collared & Buttoned)', 'T-Shirts and Casual Tops', 'Sleeveless Tops', 'Crop Tops and Trendy Styles', 'Formal and Dressy Tops', 'Fashionable Shoulder Styles', 'Specialty Tops', 'Polos and Activewear', 'Jeans and Denim', 'Casual Pants', 'Skirts and Skorts', 'Shorts', 'Formal and Workwear', 'Specialty Pants and Jumpsuits', 'Athleisure and Leggings', 'Other Specialty Bottoms']
Sizelist = ['XS', 'S', 'M', 'L', 'XL']
ColorList = ['Red', 'Blue', 'Grey', 'White', 'Black']
NONECOLIST()
ECOLIST()
# Describe this function...
def Check_Inactivity():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
if 0 == (pir_1.state):
InactiveTime = (InactiveTime if isinstance(InactiveTime, Number) else 0) + 1
if 70 <= InactiveTime:
while not (btnA.wasPressed()):
Tb1.show()
Tb2.show()
Tb3.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
BtnC.hide()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setPosition(25, 30)
Tb1.setText('Battery Saver Mode')
Tb2.setPosition(25, 60)
Tb2.setText('Press Left Button to Exit')
InactiveTime = 0
while btnA.isPressed():
pass
else:
InactiveTime = 0
# Describe this function...
def Select_Category():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
while btnC.isPressed():
pass
MAXLength = len(Categorys)
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb2.setFont(lcd.FONT_Default)
Tb4.setFont(lcd.FONT_Default)
Tb5.setFont(lcd.FONT_DefaultSmall)
BtnB.setText('Back')
BtnC.setText('Select category')
Tb1.setPosition(35, 15)
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb5.setPosition(35, 185)
BtnB.setPosition(140, 224)
BtnC.setPosition(200, 224)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 16 + 0.15)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Categorys[int((Angle - 1) - 1)]))
Tb2.setText(str(Categorys[int((Angle + 0) - 1)]))
Tb3.setText(str(Categorys[int((Angle + 1) - 1)]))
Tb4.setText(str(Categorys[int((Angle + 2) - 1)]))
Tb5.setText(str(Categorys[int((Angle + 3) - 1)]))
if btnC.isPressed():
CatergoryNumber = Angle + 1
Select_item()
MAXLength = len(Categorys)
# Describe this function...
def Select_item():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
Tb1.hide()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
BtnB.setText('Back')
BtnC.setText('Select item')
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setFont(lcd.FONT_DefaultSmall)
Tb5.setFont(lcd.FONT_DefaultSmall)
triangle0.show()
triangle0.setSize(7, 90, 7, 120, 25, 105)
if Angle == 0:
MAXLength = len(Shirts_Collared_Buttoned_)
while not (btnB.isPressed()):
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * MAXLength + 0.15)
if Angle == 0:
Tb2.setText('')
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
elif Angle == MAXLength - 1:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText('')
else:
Tb2.setText(str(Shirts_Collared_Buttoned_[int((Angle + 0) - 1)]))
Tb3.setText(str(Shirts_Collared_Buttoned_[int((Angle + 1) - 1)]))
Tb4.setText(str(Shirts_Collared_Buttoned_[int((Angle + 2) - 1)]))
if btnC.isPressed():
triangle0.hide()
iTEMnUMBER = Angle + 1
SelectedItem = Shirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
Selected_item()
Tb2.setPosition(35, 45)
Tb3.setPosition(25, 100)
Tb4.setPosition(35, 155)
Tb2.setFont(lcd.FONT_Default)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_Default)
Tb1.setText('')
Tb5.setText('')
while btnB.isPressed():
pass
elif Angle == 1:
pass
elif Angle == 2:
pass
elif Angle == 3:
pass
elif Angle == 4:
pass
elif Angle == 5:
pass
elif Angle == 6:
pass
elif Angle == 7:
pass
elif Angle == 8:
pass
elif Angle == 9:
pass
elif Angle == 10:
pass
elif Angle == 11:
pass
elif Angle == 12:
pass
elif Angle == 13:
pass
elif Angle == 14:
pass
elif Angle == 15:
pass
while btnB.isPressed():
pass
# Describe this function...
def Selected_item():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
if CatergoryNumber == 1:
ECOalt = ECOShirts_Collared_Buttoned_[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 2:
pass
elif CatergoryNumber == 3:
pass
elif CatergoryNumber == 4:
pass
elif CatergoryNumber == 5:
pass
elif CatergoryNumber == 6:
pass
elif CatergoryNumber == 7:
pass
elif CatergoryNumber == 8:
pass
elif CatergoryNumber == 9:
ECOalt = JeansandDenim[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 10:
pass
elif CatergoryNumber == 11:
pass
elif CatergoryNumber == 12:
pass
elif CatergoryNumber == 13:
ECOalt = FormalandWorkwear[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 14:
ECOalt = SpecialtyPantsandJumpsuits[int(iTEMnUMBER - 1)]
elif CatergoryNumber == 15:
pass
elif CatergoryNumber == 16:
pass
while not (btnB.isPressed()):
Tb1.show()
Tb2.show()
Tb3.show()
Tb4.show()
Tb5.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Okay')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnB.setPosition(140, 224)
BtnC.setPosition(220, 224)
Tb1.setText('You have selected the')
Tb2.setText(str(SelectedItem))
Tb3.setText('would you like to try the eco')
Tb4.setText(str(ECOalt))
Tb5.setText('alternative instead')
if btnC.isPressed():
colororsize()
while btnB.isPressed():
pass
# Describe this function...
def size():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your size')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
BtnB.setText('Back')
BtnC.setText('Comfirm')
Tb6.setText('Choose your color')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def kolor():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
triangle0.show()
triangle0.setSize(7, 80, 7, 110, 25, 95)
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.show()
RFIDID.hide()
RFIDREAD.hide()
BtnA.hide()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb6.setFont(lcd.FONT_DejaVu18)
BtnB.setText('Back')
BtnC.setText('Next')
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb6.setText('Choose your color')
Tb6.setPosition(101, 197)
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(ColorList)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(ColorList[int((Angle - 1) - 1)]))
Tb2.setText(str(ColorList[int((Angle + 0) - 1)]))
Tb3.setText(str(ColorList[int((Angle + 1) - 1)]))
Tb4.setText(str(ColorList[int((Angle + 2) - 1)]))
Tb5.setText(str(ColorList[int((Angle + 3) - 1)]))
if btnC.isPressed():
Color = Angle + 1
while btnC.isPressed():
pass
while not (btnB.isPressed()):
Tb6.setText('Choose your size')
BtnB.setText('Back')
BtnC.setText('Comfirm')
Angle = math.floor((((pbhub_1.analogRead(0)) - 14) / 212) * 5 + 0.15)
MAXLength = len(Sizelist)
if Angle == 0:
Tb1.setText('')
Tb2.setText('')
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == 1:
Tb1.setText('')
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
elif Angle == MAXLength - 2:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText('')
elif Angle == MAXLength - 1:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText('')
Tb5.setText('')
else:
Tb1.setText(str(Sizelist[int((Angle - 1) - 1)]))
Tb2.setText(str(Sizelist[int((Angle + 0) - 1)]))
Tb3.setText(str(Sizelist[int((Angle + 1) - 1)]))
Tb4.setText(str(Sizelist[int((Angle + 2) - 1)]))
Tb5.setText(str(Sizelist[int((Angle + 3) - 1)]))
if btnC.isPressed():
Size = Angle + 1
while btnC.isPressed():
Tb6.setText(str((str(CatergoryNumber) + str(((str(iTEMnUMBER) + str(((str(Color) + str(Size))))))))))
while btnB.isPressed():
pass
while btnB.isPressed():
pass
# Describe this function...
def colororsize():
global ECOShirts_Collared_Buttoned_, Shirts_Collared_Buttoned_, InactiveTime, CatergoryNumber, ECOT_ShirtsandCasualTops, T_ShirtsandCasualTops, RFIDreaded, MAXLength, ECOalt, iTEMnUMBER, ECOSleevelessTops, SleevelessTops, Color, Size, SelectedItem, ECOCropTopsandTrendyStyles, CropTopsandTrendyStyles, Categorys, JeansandDenim, FormalandWorkwear, SpecialtyPantsandJumpsuits, ECOFormalandDressyTops, FormalandDressyTops, Sizelist, ECOFashionableShoulderStyles, FashionableShoulderStyles, ColorList, ECOSpecialtyTops, SpecialtyTops, ECOPolosandActivewear, PolosandActivewear, ECOJeansandDenim, ECOCasualPants, CasualPants, ECOSkirtsandSkorts, SkirtsandSkorts, ECOshorts, Shorts, ECOFormalandWorkwear, ECOSpecialtyPantsandJumpsuits, ECOAthleisureandLeggings, AthleisureandLeggings, ECOOtherSpecialtyBottoms, OtherSpecialtyBottoms, Angle
while not (btnB.isPressed()):
Tb3.setText('')
Tb4.setText('')
Tb5.setText('')
Tb1.show()
Tb6.hide()
RFIDID.hide()
RFIDREAD.hide()
BtnA.show()
BtnB.show()
BtnC.show()
InactiveTimer.hide()
InactiveTimerNumber.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.setFont(lcd.FONT_DejaVu18)
Tb5.setFont(lcd.FONT_DejaVu18)
BtnA.setText('Color')
BtnB.setText('Back')
BtnC.setText('Size')
Tb1.setPosition(30, 30)
Tb2.setPosition(30, 60)
Tb3.setPosition(30, 90)
Tb4.setPosition(30, 120)
Tb5.setPosition(30, 150)
BtnA.setPosition(50, 224)
BtnB.setPosition(140, 224)
BtnC.setPosition(230, 224)
Tb1.setText('Choose your color')
Tb2.setText('Choose your size')
if btnA.isPressed():
kolor()
elif btnC.isPressed():
size()
triangle0.hide()
Tb6.hide()
while btnB.isPressed():
pass
Startup()
while True:
Check_Inactivity()
RFIDREAD.setText('Nothing scanned')
if btnC.wasPressed():
Select_Category()
elif rfid_0.isCardOn():
RFIDREAD.setText(str(rfid_0.readUid()))
RFIDreaded = rfid_0.readUid()
RFIDItem()
triangle0.hide()
SQ1.hide()
SQ2.hide()
SQ3.hide()
SQ4.hide()
SQ5.hide()
Tb1.setFont(lcd.FONT_DejaVu18)
Tb2.setFont(lcd.FONT_DejaVu18)
Tb3.setFont(lcd.FONT_DejaVu18)
Tb4.hide()
Tb5.hide()
Tb6.hide()
RFIDID.show()
RFIDREAD.hide()
BtnA.hide()
BtnB.hide()
InactiveTimer.show()
InactiveTimerNumber.show()
Tb1.setPosition(25, 30)
Tb1.setText('Scan an item or')
Tb2.setPosition(25, 60)
Tb2.setText('choose a category')
Tb3.setPosition(25, 90)
Tb3.setText('to get started')
RFIDID.setPosition(185, 3)
RFIDID.setText('RFID:')
RFIDREAD.setPosition(217, 3)
RFIDREAD.setText('Nothing scanned')
BtnC.setPosition(182, 224)
BtnC.setText('Choose a category')
InactiveTimer.setPosition(3, 3)
InactiveTimer.setText('Inactive Time:')
InactiveTimerNumber.setPosition(90, 3)
InactiveTimerNumber.setText(str(InactiveTime))
wait_ms(2)
Comments
Please log in or sign up to comment.