Welcome to Hackster!
Hackster is a community dedicated to learning hardware, from beginner to pro. Join us, it's free!
Viktor Shin
Published

How to Connect RPi Pico to Twitter using WIZnet Ethernet HAT

This projects aims to guide how to connect Rpi Pico to Twitter with help of WIZnet Ethernet HAT, IFTTT and Micropython

BeginnerFull instructions provided1 hour115
How to Connect RPi Pico to Twitter using WIZnet Ethernet HAT

Things used in this project

Story

Read more

Code

post-tweet.py

MicroPython
from usocket import socket
from machine import Pin,SPI
import network
import time
import urequests

#W5x00 chip init
def w5x00_init():
    spi=SPI(0,2_000_000, mosi=Pin(19),miso=Pin(16),sck=Pin(18))
    nic = network.WIZNET5K(spi,Pin(17),Pin(20)) #spi,cs,reset pin
    nic.active(True)
    nic.ifconfig(('192.168.11.30','255.255.255.0','192.168.11.1','8.8.8.8'))
    while not nic.isconnected():
        time.sleep(1)
        print(nic.regs())
    print(nic.ifconfig())
        
def main():
    w5x00_init()

    message = "https://maker.ifttt.com/trigger/post-tweet/with/key/YOUR_API_KEY_HERE?value1=Hello%20World"
    urequests.post(message)
    
if __name__ == "__main__":
    main()

Pico Customer Firmware

MicroPython
No preview (download only).

Credits

Viktor Shin
10 projects • 6 followers
Business Development Manager at WIZnet
Contact

Comments

Please log in or sign up to comment.