Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 5755

General • Re: PICO W Getting Started - I2C scanner Build Errors

$
0
0
Some progress with getting a USB device recognised.
As a work around I copied the working Blink project and edited the main.c and CMakeLists.txt to reflect the Hello World USB example.
( As noted above Cmake was failing to find nmake in some instances. I am not clear where the directive for finding nmake should be or if that is needed.) - hence the workaround by cloning.

Working 'Hello World' on PICO W

CMakeLists.txt

Code:

cmake_minimum_required(VERSION 3.12)set(PICO_BOARD pico_w)include(pico_sdk_import.cmake)project(hello_w C CXX ASM)pico_sdk_init()if (TARGET tinyusb_device)    add_executable(hello_w   main.c   )    # pull in common dependencies    target_link_libraries(hello_w pico_stdlib pico_cyw43_arch_none)    # enable usb output, disable uart output    pico_enable_stdio_usb(hello_w 1)    pico_enable_stdio_uart(hello_w 0)    # create map/bin/hex/uf2 file etc.    pico_add_extra_outputs(hello_w)    # add url via pico_set_program_url   # example_auto_set_url(hello_w)elseif(PICO_ON_DEVICE)    message(WARNING "not building hello_w because TinyUSB submodule is not initialized in the SDK")endif()
main.c

Code:

/** * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. * * SPDX-License-Identifier: BSD-3-Clause */#include <stdio.h>#include "pico/stdlib.h"#include "pico/cyw43_arch.h"int main() {    stdio_init_all();    while (true) {        printf("Hello, world!\n");        sleep_ms(1000);    }}
The USB device enumerates correctly in Windows and appears as a COM port however there is also an 'Other Device' this one is called 'Reset' and has the relevant HID and PID !!

Small steps but no I2C Scanner as yet.
Ted

Statistics: Posted by tfcroft4 — Wed Jan 31, 2024 9:59 pm



Viewing all articles
Browse latest Browse all 5755

Trending Articles


FLASHBACK WITH SIRASA FM AT GALGAMUWA 2022


Mp3 Download: Mdu - Mazola


Imitation gun was fired at motorist in Leicester road-rage incident


Ndebele names


MCKINNEY EMALINE “EMMA” OF WES...


Okra & Motia — The Workshop (Prod by Hammer)


Skint TV teen to be sentenced


Moondru Mudichu 19-09-2017 – Polimer tv Serial


YOSVANI JAMES Arrested by Miami-Dade County Corrections on Jan 10, 2017


Stories • Goddess Stepmom