Skip to content
Discussion options

You must be logged in to vote

Wow amazing. Thank you everyone for your inputs. So, here is the final code that is working for 3 LEDS

from machine import PWM
import machine
import sys
import time

spi = machine.SPI(2, baudrate=8000000, polarity=0, phase=0, sck=machine.Pin(40), mosi=machine.Pin(13), miso=machine.Pin(38), firstbit=0)

def convert_data():
    red = 0xFFFF
    green = 0x0000
    blue = 0x0000
    color = red << 32 | green << 16 | blue
    data = []
    
    
    print(data)    
    for j in range(3):        
        for i in range(48):
            if((color >> i) & 0x1):
                data.append(0xFC)
            else:
                data.append(0xC0)
    return data
            
buf = convert_data()
s…

Replies: 5 comments 16 replies

Comment options

You must be logged in to vote
2 replies
@robert-hh
Comment options

@ujur007
Comment options

Comment options

You must be logged in to vote
1 reply
@ujur007
Comment options

Comment options

You must be logged in to vote
7 replies
@ujur007
Comment options

@GitHubsSilverBullet
Comment options

@robert-hh
Comment options

@GitHubsSilverBullet
Comment options

@ujur007
Comment options

Comment options

You must be logged in to vote
6 replies
@ujur007
Comment options

@ujur007
Comment options

@robert-hh
Comment options

@robert-hh
Comment options

@ujur007
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by ujur007
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants