Go to advanced search

by scotty101
Tue May 21, 2019 12:39 pm
Forum: Astro Pi
Topic: Joystick registers double
Replies: 2
Views: 59

Re: Joystick registers double

I believe you can add a check to the callback function to tell whether the event was triggered by pressing the joystick or releasing it. According to the tutorial (https://projects.raspberrypi.org/en/projects/getting-started-with-the-sense-hat/10) def up(): if event.action == 'pressed': print("Press...
by scotty101
Tue May 21, 2019 8:59 am
Forum: Beginners
Topic: Drone Swarm
Replies: 3
Views: 104

Re: Drone Swarm

:shock: Wow! I don't mean to burst your bubble but this is a HUGE project and well beyond that can be simply described in a tutorial for beginners. This is the type of thing that a University research team will spent many years developing. How about you start with one drone and continue from there. ...
by scotty101
Mon May 20, 2019 1:44 pm
Forum: Automation, sensing and robotics
Topic: Volume Scale
Replies: 2
Views: 81

Re: Volume Scale

Sparkfun have some IR distance sensors that would be compatible with the Pi. They claim 5mm accuracy and are much cheaper than laser options (which sparkfun have some of too) https://www.sparkfun.com/products/14588 PiMoRoNi also have a time of flight sensor which is less accurate but comes with code...
by scotty101
Mon May 20, 2019 12:18 pm
Forum: General discussion
Topic: Raspberry 3(b+) and RTC DS1307
Replies: 1
Views: 76

Re: Raspberry 3(b+) and RTC DS1307

You haven't shared what your problem is so all I can do is link to a tutorial that explains how it can be done.

https://learn.adafruit.com/adding-a-rea ... i?view=all
by scotty101
Mon May 20, 2019 6:50 am
Forum: Beginners
Topic: Down convert +24DC to 5V
Replies: 5
Views: 125

Re: Down convert +24DC to 5V

dl324 wrote:
Mon May 20, 2019 12:36 am
You'd fry your Pi.
Wrong answer. Nothing would happen because there wouldn't be a complete circuit.

In this case the COM pin should be used as ground
by scotty101
Thu May 16, 2019 12:33 pm
Forum: Python
Topic: tkinter Text Widget putting "{}" around text I insert
Replies: 6
Views: 132

Re: tkinter Text Widget putting "{}" around text I insert

Change

Code: Select all

T.insert("1.0", f1)
to

Code: Select all

T.insert("1.0", x)
You are inserting the whole song each time rather than each line.
by scotty101
Thu May 16, 2019 12:29 pm
Forum: Beginners
Topic: Help pulling data off a EEPROM
Replies: 7
Views: 140

Re: Help pulling data off a EEPROM

What have you connected the A1, A2, A3 pins to? Your picture is potato quality so I can't tell.

They are normally connected to a combination of Vcc or Vss depending on what I2C address you want to EEPROM connected to. I'd try connecting them all to ground (Vss).
by scotty101
Thu May 16, 2019 8:05 am
Forum: Other programming languages
Topic: Run Matlab Code on Raspberry Pi
Replies: 3
Views: 92

Re: Run Matlab Code on Raspberry Pi

How about this one http://www.matrixlab-examples.com/using-matlab.html ? That's an intro to MATLAB tutorial rather than a MATLAB on the Pi tutorial. offifee, MATLAB is an expensive bit of software that not many hobbyists have access to, as such tutorials outside the official Mathworks website are f...
by scotty101
Wed May 15, 2019 7:33 am
Forum: Troubleshooting
Topic: Trouble connecting to Google Calendar from RPi
Replies: 2
Views: 61

Re: Trouble connecting to Google Calendar from RPi

Two things you could try Running the code using a debugger like the one inside Thonny to see how far the code gets and which path it takes Adding some print statements to the code at various points so you can tell that the lines of code before have been executes. If you can't figure it out, you migh...
by scotty101
Fri May 10, 2019 3:54 pm
Forum: General discussion
Topic: How to find "dt" in the equation of converting raw gyro data into angle?
Replies: 4
Views: 169

Re: How to find "dt" in the equation of converting raw gyro data into angle?

Yep a loop will work. Could be an infinite loop or as your say you could just loop 100 times
(Or as many as you want)
If you put a small delay in the loop it will slow down how often the sensor is ready and increase dt.
by scotty101
Fri May 10, 2019 1:09 pm
Forum: General discussion
Topic: How to find "dt" in the equation of converting raw gyro data into angle?
Replies: 4
Views: 169

Re: How to find "dt" in the equation of converting raw gyro data into angle?

dt is "delta time" meaning the change in time. In this case it means how long has elapsed since the gyro reading was last taken. The value of this can either be calculated by recording the current time when you take a reading and comparing it to the last time or it can be a fixed value if your syste...
by scotty101
Mon May 06, 2019 3:46 pm
Forum: Python
Topic: Game in python
Replies: 3
Views: 163

Re: Game in python

By client side do you mean on a web browser? I don't know of any use of Python as a browser based language.
JavaScript would be the normal language used client side.
by scotty101
Sun May 05, 2019 8:48 pm
Forum: Beginners
Topic: Adding a second button to my project
Replies: 2
Views: 90

Re: Adding a second button to my project

You need to place the reading and processing of the two buttons in to the same 'while True' loop.

At the moment your code gets stuck in the first loop and never enters the second to process the second button.
by scotty101
Sat May 04, 2019 7:49 am
Forum: Python
Topic: Game in python
Replies: 3
Views: 163

Re: Game in python

Sounds like the end goal of a series of learning exercises you will have to take first. If you want the game to work in the browser then you'll need to have some HTML, CSS and maybe JavaScript experience too. Python would be able to act as the 'server-side' program to receive login, games moves etc ...
by scotty101
Sat May 04, 2019 7:42 am
Forum: Automation, sensing and robotics
Topic: Motors - What Type, How to use?
Replies: 6
Views: 265

Re: Motors - What Type, How to use?

Could be almost anything and we'd only be guessing without seeing a picture of the motor or knowing whether there is any text on the motor. 3 wires may mean a servo motor but could also be other things. If the Pi is 'crashing' it means that the mysterious motor is drawing to much power and causing t...
by scotty101
Wed May 01, 2019 3:14 pm
Forum: Python
Topic: Need help with Python MySQL (pymysql)
Replies: 4
Views: 195

Re: Need help with Python MySQL (pymysql)

I'm guessing that the MySQL server is on a separate computer and not run on the Raspberry Pi? If so, has MySQL been configured to accept connections from other hosts? Root user access from remote hosts is disabled by default https://stackoverflow.com/questions/14779104/how-to-allow-remote-connection...
by scotty101
Wed May 01, 2019 3:12 pm
Forum: Automation, sensing and robotics
Topic: Connecting an HD4470 character LCD to the Raspberry PI (or an MCU) using just two wires I2C
Replies: 11
Views: 392

Re: Connecting an HD4470 character LCD to the Raspberry PI (or an MCU) using just two wires I2C

Does this come with any software library? Or is it just the plans to connect an off the shelf GPIO expander to an LCD?
by scotty101
Wed May 01, 2019 12:25 pm
Forum: Python
Topic: need some help with classes in Python
Replies: 3
Views: 3987

Re: need some help with classes in Python

Watch a few of Cory Schafer's videos on Youtube. https://www.youtube.com/watch?v=ZDa-Z5JzLYM&vl=en This first one explains how to create a class to store details about Employees. The rest of the series will help too. At the moment you haven't created a PhoneBook class, you've created a class that on...
by scotty101
Wed May 01, 2019 8:57 am
Forum: Gaming
Topic: How can I use a ultrasonic sensor to move a sprite up or down?
Replies: 2
Views: 186

Re: How can I use a ultrasonic sensor to move a sprite up or down?

You might find PyGame Zero easier if you are a beginner. https://pygame-zero.readthedocs.io/en/stable/ Your code at the moment doesn't have any thing in there to update the position of the objects, most PyGame programs have a "main loop" which periodically redraws/updates items. The code to change t...
by scotty101
Tue Apr 30, 2019 1:39 pm
Forum: Advanced users
Topic: Ex-zone?
Replies: 4
Views: 221

Re: Ex-zone?

I worked in a company doing Ex equipment for my summer Uni placement over 10 years ago so this is partially remembered information and not professional advice. Something like the Pi could be used but it would require a sufficiently robust enclosure to prevent the ingress of explosive gases and that ...
by scotty101
Tue Apr 30, 2019 9:16 am
Forum: Automation, sensing and robotics
Topic: Sprint Timer
Replies: 10
Views: 393

Re: Sprint Timer

You can use ultrasonic eg: if a person passes near the ultrasonic the distance reading changes so you can say that a person passed. and optionally you can use a 7 segment display to display the time, or even better a computer monitor. I doubt that an ultrasonic sensor would have the accuracy or spe...
by scotty101
Mon Apr 29, 2019 11:06 pm
Forum: Interfacing (DSI, CSI, I2C, etc.)
Topic: Arduino Serial Code to RPi Serial Code
Replies: 4
Views: 204

Re: Arduino Serial Code to RPi Serial Code

Have a look at C code tutorials that explain the Union typedef. A Union will create a type definition that will exist in the same section of memory but can be many different data types. For example in this case it is both a structure of type MsgToHoverBoard and an array of bytes. As the structure is...
by scotty101
Mon Apr 29, 2019 1:51 pm
Forum: Beginners
Topic: How do I do an HTTP POST?
Replies: 4
Views: 124

Re: How do I do an HTTP POST?

Python-requests is a very well documented library
https://2.python-requests.org/en/master/

Here is a link to the perform an HTTP POST
https://2.python-requests.org/en/master ... t-requests
by scotty101
Mon Apr 29, 2019 1:43 pm
Forum: Automation, sensing and robotics
Topic: How to Convert the measurement range of MPU6050?
Replies: 12
Views: 285

Re: How to Convert the measurement range of MPU6050?

Why not have a look at some existing python implementations that read the MPU6050?

There is a decent one here
https://github.com/Tijndagamer/mpu6050/ ... mpu6050.py

It just divides the raw values by the appropriate amount depending on the range setting.
by scotty101
Sat Apr 27, 2019 9:20 pm
Forum: Python
Topic: Running Pygame Zero in Thonny
Replies: 3
Views: 320

Re: Running Pygame Zero in Thonny

Anyone know anything more about this?

PyGame Zero works fine on my Pi in Thonny but not on the Pi's used at the Code Club I volunteer at.

Go to advanced search