Go to advanced search

by AndersM
Sun Sep 27, 2015 12:32 pm
Forum: Automation, sensing and robotics
Topic: reading serial data from sensor
Replies: 11
Views: 2860

Re: reading serial data from sensor

Did some testing with pygame and serial input. 1) Not flushing input gives a very (many seconds) delayed response 2) Flushing gives input errors when part of the transmission is flushed. (Like: 1023 becomes 23) Ok. It worked as I thought Now. How to avoid the problem? Edit: Fixed the problem by lett...
by AndersM
Wed Sep 23, 2015 10:41 am
Forum: Automation, sensing and robotics
Topic: reading serial data from sensor
Replies: 11
Views: 2860

Re: reading serial data from sensor

I'm new to programming serial communication so I am guessing from what I managed to understand (misunderstand?) . I thought that continuously write serial data might make the Pi read old data if the ATTiny sends it faster than the Pi reads it. But flushing the receive buffer solves that I assume. Co...
by AndersM
Tue Sep 22, 2015 6:19 pm
Forum: Automation, sensing and robotics
Topic: reading serial data from sensor
Replies: 11
Views: 2860

reading serial data from sensor

Hi! I have a ATTiny and uses it to read analog input from a sensor and send it through serial communication to the Pi. Now I want to make a program (in Python) that reads the a analog input approx. 30 times per second. What is the best approach to get latest data to the Pi as soon as possible? I thi...
by AndersM
Tue Sep 22, 2015 5:51 pm
Forum: Astro Pi
Topic: Temperature Value Shown on LEDs
Replies: 19
Views: 22700

Re: Temperature Value Shown on LEDs

Made Python program that displays a temperature scale from violet to red using a "trick" with HLS hue to easily create the colours in the scale. import time import colorsys from sense_hat import SenseHat sense = SenseHat() #The limits of the temperature scale MAXTEMP = 40.0 MINTEMP = 0.0 #The limits...
by AndersM
Mon Sep 21, 2015 8:43 am
Forum: Beginners
Topic: Read value from python script to PHP
Replies: 2
Views: 568

Re: Read value from python script to PHP

Let python write the value to a file and then let php read that file?
I used that solution to get readings from the Sense HAT sensors on a web-page.
by AndersM
Tue Sep 15, 2015 12:46 pm
Forum: Astro Pi
Topic: Temperature Value Shown on LEDs
Replies: 19
Views: 22700

Re: Temperature Value Shown on LEDs

Also see this thread on temperature sensors and ambient temperature.
by AndersM
Sun Sep 06, 2015 3:34 pm
Forum: Astro Pi
Topic: Calibrating SenseHAT
Replies: 12
Views: 10237

Re: Calibrating SenseHAT

Even after I followed the calibration instructions above I got strange results in my test programs.
But then I found this topic about polling and the IMU sensor:
viewtopic.php?f=104&t=110594

Using the polling tread solution everything works! :) Thanks ShiftPlusOne!
by AndersM
Sun Sep 06, 2015 1:51 pm
Forum: Astro Pi
Topic: Astro Pi Temperature Sensor Reading
Replies: 64
Views: 44994

Re: Astro Pi Temperature Sensor Reading

Made some tests: Placing the "naked" Pi2+Sense HAT in the room, refrigerator and the freezer I got the following function for temperature: Ta = 0.0071*Tm*Tm+0.86*Tm-10.0 Tm = measured with the temp+humidity sensor Ta = ambient temperature It was running Rasbian+a program reading temperature every 5 ...

Go to advanced search