![]() I had his X velocity locked at ‘2’, and changing it to ‘1’ made everything to work. I decided I should scale the motion updates by the amount of time elapsed since the previous update, but the framerate is pretty much dead on at 60fps, so that made no real difference other than to affect the speed of all the objects on-screen.Īfter playing with it for a while, I realized the Commando was reaching the x-coordinate of the crosshair before the y-coordinate. Instead, the commando kept swooping in just above it. The idea was to get the Commando to swoop in from the side of the screen and cross right through the middle of the crosshair. Originally I calculated his starting velocity and acceleration from the usual equation for a parabola, with the origin located at the player’s crosshair and a starting reference point at x = -crosshairLocation.X. I worked on the motion code for the Sky Commando tonight. Posted on JanuNovemTags circuit, led, python Leave a comment on RGB LED Sectional Chart Weather What a fascinating modern age we live in tPixelColorRGB(airports, color, color, color) Print('Setting light %s to %s' % (airports, get_color(ceiling, visibility))) Print('Visibility, sm : %s' % visibility) Visibility = metar.find('visibility_statute_mi').text Station_id = metar.find('station_id').text.upper()Ĭeiling = metar.find('sky_condition').get('cloud_base_ft_agl') # Intialize the library (must be called once before other functions). Strip = Adafruit_NeoPixel(LED_COUNT, LED_PIN, LED_FREQ_HZ, LED_DMA, LED_INVERT, LED_BRIGHTNESS, LED_CHANNEL) # Create NeoPixel object with appropriate configuration. If visibility = 1 and visibility = 3 and visibility = 500 and ceiling = 1000 and ceiling < 3000: Print('ERROR could not parse visibility: %s, defaulting to 10 SM' % visibility) LED_INVERT = False # True to invert the signal (when using NPN transistor level shift) LED_BRIGHTNESS = 255 # Set to 0 for darkest and 255 for brightest LED_DMA = 5 # DMA channel to use for generating signal (try 10) LED_FREQ_HZ = 800000 # LED signal frequency in hertz (usually 800khz) #LED_PIN = 10 # GPIO pin connected to the pixels (10 uses SPI /dev/spidev0.0). LED_PIN = 18 # GPIO pin connected to the pixels (18 uses PWM!). IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ![]() # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. # Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: Otherwise, you may get a confusing error saying station_id is not a valid field. Note: Make sure you pass the station identifiers to the web service in all capitals. It is based on the CircuitPython library here. ![]() I made a last-minute untested change to it, but it should be pretty close to working. I wrote some Python code that will hit the US’s aviation weather web service to get the weather data and update the lights.
0 Comments
Leave a Reply. |