Spaces:
Sleeping
Sleeping
umgefahren
commited on
More components
Browse files
agent.py
CHANGED
|
@@ -126,6 +126,55 @@ COMPONENT_INFO_DICT = {
|
|
| 126 |
"ka": "Kathode",
|
| 127 |
},
|
| 128 |
},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 129 |
}
|
| 130 |
|
| 131 |
|
|
|
|
| 126 |
"ka": "Kathode",
|
| 127 |
},
|
| 128 |
},
|
| 129 |
+
"DHT22": {
|
| 130 |
+
"pins": {
|
| 131 |
+
"VCC": "Positive voltage",
|
| 132 |
+
"SDA": "Digital data pin (input/output)",
|
| 133 |
+
"NC": "Not connected",
|
| 134 |
+
"GND": "Ground",
|
| 135 |
+
}
|
| 136 |
+
},
|
| 137 |
+
"HC-SR04": {
|
| 138 |
+
"pins": {
|
| 139 |
+
"VCC": "Supply Voltage (5V)",
|
| 140 |
+
"TRIG": "Trigger Pin (input)",
|
| 141 |
+
"ECHO": "Echo Pin (output)",
|
| 142 |
+
"GND": "Ground",
|
| 143 |
+
}
|
| 144 |
+
},
|
| 145 |
+
"DS1307": {
|
| 146 |
+
"pins": {
|
| 147 |
+
"5V": "Supply Voltage (5V)",
|
| 148 |
+
"SCL": "I2C Clock Line",
|
| 149 |
+
"SDA": "I2C Data Line",
|
| 150 |
+
"GND": "Ground",
|
| 151 |
+
}
|
| 152 |
+
},
|
| 153 |
+
"MPU6050": {
|
| 154 |
+
"pins": {
|
| 155 |
+
"VCC": "Supply Voltage (3.3V or 5V)",
|
| 156 |
+
"SCL": "I2C Clock Line",
|
| 157 |
+
"SDA": "I2C Data Line",
|
| 158 |
+
"GND": "Ground",
|
| 159 |
+
"AD0": "Address select pin (optional)",
|
| 160 |
+
"INT": "Interrupt pin (optional)",
|
| 161 |
+
}
|
| 162 |
+
},
|
| 163 |
+
"Slide Switch": {
|
| 164 |
+
"pins": {
|
| 165 |
+
"one": "Left terminal",
|
| 166 |
+
"two": "Common terminal",
|
| 167 |
+
"three": "Right terminal"
|
| 168 |
+
}
|
| 169 |
+
},
|
| 170 |
+
"RGB LED": {
|
| 171 |
+
"pins": {
|
| 172 |
+
"R": "Red anode",
|
| 173 |
+
"G": "Green anode",
|
| 174 |
+
"B": "Blue anode",
|
| 175 |
+
"GND": "Common cathode"
|
| 176 |
+
}
|
| 177 |
+
}
|
| 178 |
}
|
| 179 |
|
| 180 |
|
main.py
CHANGED
|
@@ -1,5 +1,5 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from agent import session_service, root_agent, APP_NAME, runner
|
| 3 |
from google.genai import types
|
| 4 |
from pprint import pprint, pformat
|
| 5 |
from uuid import uuid4
|
|
@@ -175,11 +175,19 @@ with gr.Blocks() as demo:
|
|
| 175 |
interactive=False,
|
| 176 |
render=False,
|
| 177 |
)
|
|
|
|
| 178 |
|
| 179 |
with gr.Row():
|
| 180 |
gr.Markdown(
|
| 181 |
-
"""
|
| 182 |
-
# Arduino Hardware and Software
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 183 |
"""
|
| 184 |
)
|
| 185 |
with gr.Row():
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
+
from agent import session_service, root_agent, APP_NAME, runner, COMPONENT_INFO_DICT
|
| 3 |
from google.genai import types
|
| 4 |
from pprint import pprint, pformat
|
| 5 |
from uuid import uuid4
|
|
|
|
| 175 |
interactive=False,
|
| 176 |
render=False,
|
| 177 |
)
|
| 178 |
+
COMPONENT_NAMES_MD = "\n".join([f'- {name}' for name in COMPONENT_INFO_DICT.keys()])
|
| 179 |
|
| 180 |
with gr.Row():
|
| 181 |
gr.Markdown(
|
| 182 |
+
f"""
|
| 183 |
+
# Arduino Hardware and Software Vibecoder
|
| 184 |
+
|
| 185 |
+
This is a prototype of a vibecoder (like Lovable) that can generate Arduino code and schematics for you.
|
| 186 |
+
Given a prompt, it well look up the components it has availble and generate a high-level schematic and code.
|
| 187 |
+
It compiles the code to make sure it works and then gives you a download link for the ELF file that can then be uploaded to the Arduino.
|
| 188 |
+
|
| 189 |
+
It has the following components:
|
| 190 |
+
{COMPONENT_NAMES_MD}
|
| 191 |
"""
|
| 192 |
)
|
| 193 |
with gr.Row():
|
uv.lock
CHANGED
|
The diff for this file is too large to render.
See raw diff
|
|
|