This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"last_node_id": 792, | |
"last_link_id": 458, | |
"nodes": [ | |
{ | |
"id": 1, | |
"type": "CheckpointLoaderSimple", | |
"pos": [ | |
100, | |
130 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Spyder Editor | |
@author: thekitchenscientist | |
""" | |
# Import streamlit library | |
import streamlit as st | |
from llama_cpp import Llama |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Prompts by Google https://github.com/google/generative-ai-docs/tree/main/demos/palm/web/textfx | |
@author: thekitchenscientist and Bing Chat (conversion of prompts and basic app framework) | |
""" | |
class TextFX: | |
# Initialize the list attribute with an empty list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Window x:Class="LegoLogger.MainWindow" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | |
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | |
xmlns:local="clr-namespace:LegoLogger" | |
mc:Ignorable="d" | |
Title="MainWindow" Height="450" Width="550"> | |
<Grid Loaded="Grid_Loaded"> | |
<Grid.ColumnDefinitions> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
EV3 = serial.Serial('/dev/rfcomm0') | |
textstring = "2C000000800000841300820000820000841C018200008232008475692F6D696E6473746F726D732E726766008400" | |
command = textstring.decode("hex") | |
print(command) | |
EV3.write(command) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import serial | |
from dec_to_hex import h # decimal-to-hexadecimal dictionary | |
EV3 = serial.Serial('/dev/rfcomm0') | |
# message length | |
bytecount = h[44] #look up 44 in hex dictionary | |
comm_0 = '\x00' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import modules | |
import time | |
from ev3py import ev3 | |
#create a reference to the ev3 called 'mybrick' | |
mybrick = ev3() | |
# connect with EV3 via Bluetooth | |
mybrick.connect('bt') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
# command to start motor on port A at speed 20 | |
start_motor = '\x0C\x00\x00\x00\x80\x00\x00\xA4\x00\x01\x14\xA6\x00\x01' | |
# command to stop motor on port A | |
stop_motor = '\x09\x00\x01\x00\x80\x00\x00\xA3\x00\x01\x00' | |
# send commands to EV3 via bluetooth | |
with open('/dev/rfcomm0', 'w', 0) as bt: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
play_tone = '\x0F\x00\x00\x00\x80\x00\x00\x94\x01\x81\x02\x82\xE8\x03\x82\xE8\x03' | |
# send commands to EV3 via bluetooth | |
with open('/dev/rfcomm0', 'w', 0) as bt: | |
bt.write(play_tone) |
NewerOlder