Skip to main content

5 posts tagged with "chatgpt"

chatgpt

View All Tags

Use ChatGPT to write python code

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

Recently, I found myself with some free time, and it brought back a memory from our robotics team. I remember one of the girls on the team trying to use ChatGPT to help her write code for our Masterpiece Season mission. She was hoping to get some assistance resolving a tricky problem with our robot. Unfortunately, even though the code it generated looked solid, it didn't run correctly when we tried it out on the robot.

Out of curiosity, I decided to give it a go myself to see what might have gone wrong. Here's an example of a Python snippet that looks fine at first glance:

import hub
from spike import PrimeHub, Motor, MotorPair

hub = PrimeHub()

motor_pair = MotorPair('A', 'B')

motor_pair.start(50, 0) # Move straight at 50% speed

The syntax is correct, and the code seems reasonable for controlling a Spike Prime robot. But when you upload this code to the robot, something weird happens: the robot doesn't quite behave the way it should. It might not move at all, or it could respond unpredictably.

So, what's going on here?

Well, after some quick troubleshooting, I realized there's a bit more to getting a Spike Prime robot working smoothly than just correct Python syntax. The code must align perfectly with the robot's specific hardware configuration, sensor inputs, and timing mechanisms. It's not just about writing Python - it's about writing the right Python for this context.

Looks like I've got an investigation on my hands. Time to dive deeper into how the Spike Prime API works and figure out why ChatGPT's code, while syntactically correct, doesn't hit the mark. It's a reminder that while AI tools can be incredibly useful, robotics is a nuanced field where hardware, software, and context all come into play.

If I crack the mystery, I'll be sure to share what I learn!

Fresh Hobby Sharing App powered by AI (improved)

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We are thrilled to share some exciting updates about Fresh, our AI-powered hobby-sharing app. Over the past few months, we've been working tirelessly to enhance your experience by incorporating valuable feedback from tech experts and our vibrant community.

One of the significant improvements is the expansion of our hobby directory. We've added a plethora of new hobbies to ensure that everyone finds something that resonates with their interests. Whether you're into pottery, urban gardening, or drone racing, Fresh has got you covered.

Our chatbot has also received a significant upgrade. It now suggests nearby events based on your current location, making it easier for you to connect with like-minded enthusiasts in your area. Simply tell the chatbot what you're interested in, and it will provide personalized recommendations for events and meetups happening near you.

alt text

alt text

We've also produced new tutorial videos to help you get the most out of Fresh. These guide you through the app's features and show you how to make the most of our platform.

Moreover, we've made significant strides in enhancing the app's accessibility. Fresh is now fully functional on both desktop and mobile devices, ensuring you can stay connected to your hobbies anytime, anywhere.

We couldn't have achieved these improvements without your invaluable feedback. Thank you for being a part of our journey. The girls are committed to continually enhancing Fresh to make it the best platform for hobby enthusiasts worldwide.

Attempt to ask ChatGPT to write python

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

The team is struggling with writing Python for the first time! It's so hard, and we don't know where to start. Drag-and-drop coding in the code blocks was so easy, but now we need to learn Python and figure out what to do. The Spike Prime has some examples, but they're not so easy to understand for us.

We turned to ChatGPT for help. It does output lots of code, but it doesn't run on the app. Why? We asked our coach for help and learned that the Spike Prime only uses a specific set of Python, and the robot only knows some of the functions but not all.

It turns out that Spike Prime uses MicroPython, which is a simplified version of Python designed for microcontrollers and embedded systems. This means that not all standard Python libraries and functions are available. Some of the code that ChatGPT provides uses functions that the Spike Prime doesn't support.

This was a bit disheartening at first. We thought that learning Python would open up new possibilities, but instead, we hit a wall. However, we realized that this is just another challenge to overcome. We're now focusing on learning the specific commands and functions that are available in Spike Prime's MicroPython environment.

It's still tough, but we're making progress. We're finding tutorials and resources specifically for Spike Prime's Python coding. We're also experimenting with small bits of code to see what works and what doesn't. It's a learning process, and while it's frustrating at times, it's also exciting to see our robot respond to the code we've written.

In the end, we're hopeful that with perseverance and a better understanding of Spike Prime's Python capabilities, we'll be able to code like pros. For anyone else struggling with this, know that you're not alone, and don't hesitate to seek help and keep experimenting!

Exploring DallE

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We are interested in exploring how AI can help with our research, brainstorming, and feedback. We tried using ChatGPT and DALL·E to generate answers to our questions and to understand the best ways to use these new tools. We also had a lot of fun creating AI-generated images to help us visualize our innovation project.

Using ChatGPT, we were able to brainstorm ideas more efficiently. Whenever we hit a roadblock, we asked ChatGPT for suggestions, and it provided us with fresh perspectives we hadn't considered before. It was like having a collaborative partner available 24/7, ready to help us think through complex problems.

DALL-E, on the other hand, allowed us to bring our ideas to life visually. By inputting descriptions of concepts and scenarios related to our project, DALL-E generated images that captured the essence of our thoughts. This was incredibly helpful during team meetings, as visual aids made it easier for everyone to understand and contribute to the discussion.

One of the most enjoyable parts was creating AI-generated images for our innovation project. Seeing our ideas transformed into visuals not only made the project more tangible but also sparked new ideas and directions to explore. It was fascinating to see how the AI interpreted our descriptions and turned them into creative imagery.

Integrating AI tools like ChatGPT and DALL-E into our learning has significantly enhanced the way we approach education. They've enhanced our research process, made brainstorming sessions more productive, and provided valuable feedback on our ideas. Plus, experimenting with these tools has been both educational and fun.

Exploring LEGO Spike Prime for Education

· 2 min read
Daniel Fang
AI, Robotics & LEGO Enthusiast

We've been eagerly awaiting the latest release of the LEGO Spike Prime apps, and it's finally here! The most exciting part? It now officially supports writing code in Python. We can't wait to dive in and start coding like pros. However, our journey hasn't been without its challenges.

The introduction of Python support opens up a whole new world of possibilities for the Spike Prime. Unlike block-based coding, Python allows for more complex and efficient programming, enabling us to tackle advanced projects and fine-tune our robot's performance.

One of the first obstacles we encountered was the scarcity of comprehensive documentation. While the new Python feature is fantastic, the resources available to learn and troubleshoot are somewhat lacking. Some of the official examples even contain errors, which can be frustrating when you're trying to learn.

This is where ChatGPT comes into play. By asking ChatGPT for help, we hope to bridge the gap in documentation and get accurate code snippets that work with Spike Prime. We found that ChatGPT can provide explanations of Python concepts, help debug code, and even generate sample programs tailored to our needs.

Controlling the robot involves not just programming but also understanding real-world physics and calculations. For instance, making the robot move a certain distance requires calculations involving wheel circumference and motor rotations. ChatGPT has been instrumental in helping us understand these concepts by breaking down the calculations and explaining the physics behind them.

While there's still a learning curve, combining the new Python capabilities of Spike Prime with the support of ChatGPT has made the process much more manageable.