Ported GP8403 for Raspberry Pi Pico
![userHead](https://dfimg.dfrobot.com/dfPortrait2.png)
I am currently porting the library to MicroPython (for Raspberry Pi Pico). Here is the repo: https://github.com/couillonnade/DFRobot_GP8403/tree/master/python/RP2
I stripped down the waves generation because this is useless here to me.
Next step is to bit bang the “store” sequence because it does not respect i2c (the first chunk of data is only 3 bits and not a byte… and ACKS are NACKS in the 6 data bytes).
If anyone want to help or just test it with their hardware and give feedback, you are welcome.
I'm really new to this and I wanted to use the Dfrobot I2C DAC 0-10v to simply manage a voltage out from an input through a dashboard on blynk, is there someone that can help as to how this can be done in micropython, I've run the code in the link and I seem to get a 5v out and a 10v out on both Vouts? How do I just set a voltage say on channel 0, that could be anywhere between 0-10v. Thanks
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
If anyone interested, it has been tested on Raspberry Pi Pico.
Range, Output and Store works properly.
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
The “store”function needs to be implemented by software I2C, you can refer to python's software I2C writing method.https://github.com/DFRobot/DFRobot_GP8403/tree/master/python/raspberryPi
![](https://dfimg.dfrobot.com/nobody/makelog/b44c2ec9df9bcf983e900af0e5cb4172.png)
![userHeadPic](https://dfimg.dfrobot.com/dfPortrait2.png)
It's not entirely true because MicroPython SoftI2C (like any other I2C library) does not support sending 3 bits only, it sends bytes. In your code, the second line sends only 3 bits, it's handled in your code in _send_byte with a loop and after 3 bits it stops.
Also, the 8 data blocks wait for a NACK instead of an ACK.
This has been confirmed in the Raspberry Pi interfacing forum here: https://forums.raspberrypi.com/viewtopic.php?t=349617
Or maybe by software I2C, you mean bit banging the the data and clock like I did?
Anyway, I have implemented the same _send_data method to support your custom I2C :
https://github.com/couillonnade/DFRobot_GP8403/tree/master/micropython/RP2
After testing with the HW, I can send a PR if you are willing to accept it.
I reorganized the repo to add a Micropython folder. Here is the repo now https://github.com/couillonnade/DFRobot_GP8403/tree/master/micropython/RP2
Also fixed your samples in Python.
![p.name](https://dfimg.dfrobot.com/store/data/DFR0817/DFR0817-detail-000.jpg)