EDUCATION IN ARTIFICIAL INTELLIGENCE CAMERA PROGRAMMING
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/083d8de4242f3a43ea3e8438ca52c2a9.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/8731c3f866c3722318f370c16e859dde.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/f4b86430b9cd28033b3bbe4a7458b408.jpeg)
INTRODUCTION KNOWLEDGE REQUIREMENTS → o ��ℎ������ ����/��������/�������� o → MATERIALS → → →
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/719b129a646df4e8a8c485304c001b2f.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/719b129a646df4e8a8c485304c001b2f.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/a1d674ed2bd3c0c647811e8b67cc96b8.jpeg)
HANDLING THE ROBOT Testing the alphai library to control the robot alphai.py pip install alphai api from alphai import * motor(30, 30, 5) motor(30,alphai 30, 5) motor(left, right, duration) left right duration motor alphai alphai
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/22d29b7f9f7b0668f7e65ffab8d0c036.jpeg)
Connecting to the AlphAI robot → → → connect_bluetooth(n) connect_wifi() disconnect() from alphai import disconnect()motor(30,connect_bluetooth(n)*30,5)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
NAVIGATION WITH ULTRA SOUND Discovery of the ultra-sound sensor set_distance(True)get_distance() None set_distance(True)connect_bluetooth(n)# activate the ultrasound sensor while True: d = get_distance() # get the distance measured by the sensor print("distance:", d) Autonomous movement with ultra sound get_distance() ultrasound_race() NAVIGATION WITH THE CAMERA Discovering the camera image bluetooth_connect(n)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
set_camera("8x6") get_camera() List[List[List[int]]] image image[i, j, k] set_camerabluetooth_connect(n)("8x6")#set the camera to the correct resolution whileimageTrue:= get_camera() # get the camera image print('red', image[0, 7, 0], 'green', image[0, 7, 1], 'blue', image[0, 7, 2])
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/4e521e935594c681e4ca4cebb4372647.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/e190dd4562e44a45cbe0782d7f870360.jpeg)
First autonomous movement with the camera camera_race() image[4, 3, 0] < 100 → image[4, 3, 1] < 100 → → Autonomous robot improvements and racing
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/38dac3019e0bbd27f8bb7410cefc73dc.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/20abba4dc4ad23e7443bbb41c2cc7dfd.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/5e28c6d0e8a1493563bc486c1f488ca7.jpeg)
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/711155abd9271267ef84d8bf5c8cfcd1.jpeg)
Appendix: alphai library API ����������������������ℎ ��������() → �������� �������������������� ����������������ℎ(���������� ����������:������)→�������� �������������������� ��������()→�������� ��������������������������() ���������� ������������������()→�������� ����������������(��������,������ℎ��,����������������) duration �������������� ������ ������()→�������� ������������ ����������������()→�������� ������������ ����������������(������������:��������) ������������ ����������������()→���������� ������������ ������������(������������:������) config 2x1 4x3 8x6 16x12 21x16 32x24 64x48 ������������ ������������()→�������� ������������ ����(��������) None all std mean ������������ ����������������()→�������� As you will have noticed, the
![](https://assets.isu.pub/document-structure/220905074022-e4124b14ee945e501ef3feb359f3cc2f/v1/5173e4e76939277b068220c37424e36b.jpeg)