arduino

change array consist of coordinate(x,y) to string

change array consist of coordinate(x,y) to string Question: i have path planning project with python and the result is array consist of coordinate(x,y) like this: [(0, 1), (1, 1), (2, 1), (3, 1), (4, 1), (5, 1), (5, 2), (5, 3)] since I want to send that data to arduino to control the movement of …

Total answers: 2

Serial.serial is not working, thonny: module 'serial' has no attribute 'Serial'

Serial.serial is not working, thonny: module 'serial' has no attribute 'Serial' Question: I just started with Ardunino, Python and a serial Communication between RPI and Ardunio (using Thonny). I checked out some tutorials (e.g https://roboticsbackend.com/raspberry-pi-arduino-serial-communication/) to get my code run. But not even the standard code is running. That is my code: if __name__ == …

Total answers: 1

Send 8-bit integers over serial to Arduino

Send 8-bit integers over serial to Arduino Question: I created a music visualizer and I want to send three 8-bit integers (0-255) over serial to an Arduino using Python’s pyserial library. I have a text file called rgb.txt on my computer which has the data: 8,255,255. I am sending the data over serial with this …

Total answers: 5

Python & Arduino communication – TypeError: must be real number, not str

Python & Arduino communication – TypeError: must be real number, not str Question: I want to use the kmeans1d library to cluster some values from an Arduino, however, I got a TypeError from Python. Below is the Arduino code: void setup() { Serial.begin(9600); } void loop() { Serial.println("100, 150, 300, 130, 140"); delay(5000); } Python …

Total answers: 1

ImportError: cannot import name 'Serial' from 'serial' (unknown location)

ImportError: cannot import name 'Serial' from 'serial' (unknown location) Question: Whenever i execute the code below it gives me following Error: ImportError: cannot import name ‘Serial’ from ‘serial’ (unknown location) Code: from serial import Serial arduinodata = Serial(‘com4’,9600) print("Enter n to ON LED and f to OFF LED") while 1: input_data = raw_input() print ("You …

Total answers: 6

Serial communication between python, arduino and hairless MIDI

Serial communication between python, arduino and hairless MIDI Question: I want to send a message from python via serial to arduino uno and then from arduino to hairless MIDI to control LMMS software. The problem is that the communication in both cases goes through port COM4. Is it somehow possible to get data from python …

Total answers: 1

How to get Spotify current playing song in Python (Windows)?

How to get Spotify current playing song in Python (Windows)? Question: I want to show the current playing song in Spotify on a 16×2 LCD. I was thinking of connecting the LCD with my Arduino and then making a Python script that sends the current playing song of Spotify to the Arduino. To get to …

Total answers: 4

Sending serial communication (using Python on Ubuntu) to Arduino

Sending serial communication (using Python on Ubuntu) to Arduino Question: This is the strangest thing I have seen in quite a while. I have very basic Python code to send commands to a Arduino Uno R3 using Python running on Ubuntu. import serial import time ser = serial.Serial(‘/dev/ttyACM0’, 115200) time.sleep(2) if ser.isOpen(): print "Port Open" …

Total answers: 1